Last active
December 16, 2015 00:38
-
-
Save acoster/5348575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template<int _N> | |
struct Base | |
{ | |
Base() | |
{ | |
std::cout << _N << std::endl; | |
} | |
}; | |
template<int _N> | |
struct B : Base<_N> | |
{ | |
B<_N - 1> b; | |
}; | |
template<> | |
struct B<0> : Base<0> | |
{}; | |
int main(int, char**) | |
{ | |
B<31> b; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment