
28 Aug
2011
28 Aug
'11
9:43 a.m.
Apart from that I'm afraid I don't really see the point of this against
struct my_singleton { private: my_singleton() {} my_singleton(const my_singleton&);
public: static my_singleton& instance() { static my_singleton ins; return ins; } };
which is simple, short, fast to compile, and thread-safe. AFAIK the "static my_singleton ins;" is not thread-safe (at least, for
23.08.2011 1:15, Mathias Gaunard пишет: the MSVC compilers). http://blogs.msdn.com/b/oldnewthing/archive/2004/03/08/85901.aspx -- Best regards, Sergey Cheban