Skip to content

Instantly share code, notes, and snippets.

@acoster
Last active December 16, 2015 00:38
Show Gist options
  • Save acoster/5348575 to your computer and use it in GitHub Desktop.
Save acoster/5348575 to your computer and use it in GitHub Desktop.
#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