Consider this example code:
template
char register_(){
return D::get_dummy(); // static function
}
template
struct Foo{
Something like that comes to my mind:
// in some c++ file (to make i with internal linkage)
static int i = init_dummy(Foo::dummy);
where init_dummy is defined like this:
int init_dummy(...)
{
return 1;
}
Due to variable args you can put more initializations there like:
static int i = init_dummy(Foo::dummy, Foo::dummy, Foo::dummy);