mirror of
https://github.com/RPCSX/xbyak.git
synced 2025-03-03 08:09:39 +00:00
unorder init by one file
This commit is contained in:
parent
3f66cdac5d
commit
cb425242fd
43
test/lib_min.cpp
Normal file
43
test/lib_min.cpp
Normal 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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user