unorder init by one file

This commit is contained in:
MITSUNARI Shigeo 2012-12-03 09:28:05 +09:00
parent 3f66cdac5d
commit cb425242fd

43
test/lib_min.cpp Normal file
View File

@ -0,0 +1,43 @@
#include <stdio.h>
struct A {
int a;
A()
: a(5)
{
puts("A cstr");
}
~A()
{
puts("A dstr");
}
void put() const
{
printf("a=%d\n", a);
}
};
template<int dummy = 0>
struct XT {
static A a;
};
template<int dummy>
A XT<dummy>::a;
typedef XT<0> X;
static struct Init {
Init()
{
puts("Init");
X::a.put();
}
} s_init;
int main()
{
puts("main");
X::a.put();
}