15 Jan
2008
15 Jan
'08
7:29 p.m.
Nat Goodspeed wrote:
My one additional comment on design: people are very used to writing my_singleton::instance()->member. I like the coolness of writing my_singleton::instance->member instead, but I suspect I'll hear some grumbling from colleagues who keep getting reminded by compile errors. I wish it were possible to provide 'instance' as both a static data member and a static member function... But I'd be good with having this become the new convention.
It's actually easy, although I don't think it's a good idea: class instance_t { T* operator->() const; T* operator()() const; }; In Christ, Steven Watanabe