Skip to content

Instantly share code, notes, and snippets.

@minad
Created January 10, 2010 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minad/273817 to your computer and use it in GitHub Desktop.
Save minad/273817 to your computer and use it in GitHub Desktop.
g++ -o test test.cpp
objdump -S test | grep 0x375f00
template<int i>
struct fac { static const int result = fac<i - 1>::result * i; };
template<>
struct fac<0> { static const int result = 1; };
int main() {
return fac<10>::result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment