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,505 of 33,346    |
|    Ulrich Eckhardt to All    |
|    Re: Why doesn't push_back return an iter    |
|    25 Jul 12 10:02:28    |
      From: ulrich.eckhardt@dominolaser.com              Am 25.07.2012 03:05, schrieb Ivan Godard:       > On 7/24/2012 12:28 PM, Kaba wrote:       >> 24.7.2012 21:53, Bo Persson kirjoitti:       >>> If you want an iterator anyway, you can easily get one with       >>>       >>> list.insert(list.cend(), Value);       >>       >> This is a practical option.       >>       > Only if the list is not shared among threads. The STL will make each       > operation atomic, but not two together.              The "STL" (I guess you mean the C++ standard library, but it even       applies to the STL) won't do such a thing, there are no builtin       synchronizations because those are useless (see above code as example)       and expensive (especially in MP system). If you want to share containers       between threads, you have to set this up externally.              Uli                     --        [ 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