#include #include template struct A { A() { std::cout << "A::A<" << typeid(T).name() << ">\n"; } static const bool member; }; template const bool A::member = reg(typeid(A).name()); bool reg(const char* s) { std::cout << "Registering " << s << std::endl; } template const bool A::member; int main() { A ai; A ac; }