Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,751 of 33,346    |
|    fmatthew5876 to Francis Glassborow    |
|    Re: Singletons    |
|    17 Dec 12 16:29:10    |
      From: fmatthew5876@googlemail.com              On Monday, December 17, 2012 2:47:13 PM UTC-5, Francis Glassborow wrote:       > I am not sure that that is generally widespread (and it needs revision       > in the light of what C++12 offers, e.g. =delete)       >              Sure we might now use the delete, but the local static object in the static       method trick is something I've seen proposed often.                     > But that is a necessary cost for using global (mutable) data in a       > multi-threading environment.              If you know the object is not going to be used in other threads you       don't need the check.                     > Well I agree with that but I do not have that mentality, nor do good       > programmers. One size fits all mentality is the hall mark of the mediocre.              Agreed, but I haven't seen many other singleton (or I should say more       generally global data) models proposed out there in C++ world.              > Now you have to control that:)              Its a trade off, in some situations that desirable, in some not. The real       question is whether or not you want lazy evaluation.                     > Sometimes an advantage and sometimes not. You are just proposing a       > different 'one size fits all' solution, though perhaps a more versatile       > one (at a cost)              Never said this is the new silver bullet and thou shall use my proposal. Its       just an alternative with its own benefits and costs.                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca