
21 Jun
2005
21 Jun
'05
7:11 a.m.
David Abrahams wrote:
namespace whatever { class foo {};
template <class T, int = 0>
Wonderful solution! However, I wonder what the default template argument here (int = 0) is for?
struct unique_instance { T& get() { static T x; return x; }; };
namespace { foo& bar = unique_instance<foo>::get(); } }