#include <cstdio> // for printf.
struct unko
{
unko() { std::printf("unko c-tor\n"); }
~unko() { std::printf("unko d-tor\n"); }
float v = 2.71828f;
};
namespace miruna
{
template<typename T>
struct static_vars
{
static unko a;
};
template<typename T>
unko static_vars<T>::a;
template
struct static_vars<void>;
}
auto main() -> int
{
unko &a = miruna::static_vars<void>::a;
a.v += 1000;
std::printf("%lf\n", a.v);
std::printf("[main] end\n");
}
I2luY2x1ZGUgPGNzdGRpbz4JLy8gZm9yIHByaW50Zi4KCnN0cnVjdCB1bmtvCnsKCXVua28oKSB7IHN0ZDo6cHJpbnRmKCJ1bmtvIGMtdG9yXG4iKTsgfQoJfnVua28oKSB7IHN0ZDo6cHJpbnRmKCJ1bmtvIGQtdG9yXG4iKTsgfQoKCWZsb2F0IHYgPSAyLjcxODI4ZjsKfTsKCm5hbWVzcGFjZSBtaXJ1bmEKewoJdGVtcGxhdGU8dHlwZW5hbWUgVD4KCXN0cnVjdCBzdGF0aWNfdmFycwoJewoJCXN0YXRpYyB1bmtvIGE7Cgl9OwoKCXRlbXBsYXRlPHR5cGVuYW1lIFQ+Cgl1bmtvIHN0YXRpY192YXJzPFQ+OjphOwoKCXRlbXBsYXRlCglzdHJ1Y3Qgc3RhdGljX3ZhcnM8dm9pZD47Cn0KCmF1dG8gbWFpbigpIC0+IGludAp7Cgl1bmtvICZhID0gbWlydW5hOjpzdGF0aWNfdmFyczx2b2lkPjo6YTsKCglhLnYgKz0gMTAwMDsKCXN0ZDo6cHJpbnRmKCIlbGZcbiIsIGEudik7CgoJc3RkOjpwcmludGYoIlttYWluXSBlbmRcbiIpOwp9