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 31,927 of 33,346    |
|    =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to Dmitry Potapov    |
|    Re: Does memory allocation is allowed to    |
|    14 Feb 12 17:14:32    |
      4c1dedfb       From: daniel.kruegler@googlemail.com              On 2012-02-14 11:39, Dmitry Potapov wrote:       > As everyone knows, in «new my_class(my_arg);» statement, it is not       > specified what will occur first, memory allocation or argument       > evaluation. Is there any guarantee, that memory allocation won't occur       > during argument evaluation?              No.              > I.e. in the following statement:       > new my_class(another_class(third_class(1)));       >       > Does standard guarantee that memory allocation won't occur after       > third_class construction but before another_class construction?              There exists no such guarantee. The problem you are referring to was resolved       by              http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#672              From FDIS, [expr.new] p16:              "The invocation of the allocation function is indeterminately sequenced with       respect to the evaluations of expressions in the new-initializer.       Initialization of the allocated object is sequenced before the value       computation of the new-expression. It is        unspecified whether expressions in the new-initializer are evaluated if the       allocation function returns the null pointer or exits using an exception."              Maybe you could explain us a bit what you particular concerns are in regard to       this wording state? Why do you need this ordering guarantee?              HTH & Greetings from Bremen,              Daniel Krügler                            --        [ 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