Title
Order of destruction of temporaries
Status
cd1
Section
6.7.7 [class.temporary]
Submitter
Alan Nash

Created on 2000-01-27.00:00:00 last changed 188 months ago

Messages

Date: 2007-04-15.00:00:00

[Voted into the WP at the April, 2007 meeting as part of paper J16/07-0099 = WG21 N2239.]

Date: 2007-04-15.00:00:00

Proposed resolution (April, 2007):

As specified in paper J16/07-0099 = WG21 N2239.

Date: 2000-04-15.00:00:00

Notes from 04/00 meeting:

Steve Adamczyk expressed concern about constraining implementations that are capable of fine-grained parallelism -- they may be unable to determine the order of construction without adding undesirable overhead.

Date: 2008-03-17.00:00:00

6.7.7 [class.temporary] paragraph 3 simply states the requirement that temporaries created during the evaluation of an expression

are destroyed as the last step in evaluating the full-expression (1.9) that (lexically) contains the point where they were created.
There is nothing said about the relative order in which these temporaries are destroyed.

Paragraph 5, dealing with temporaries bound to references, says

the temporaries created during the evaluation of the expression initializing the reference, except the temporary to which the reference is bound, are destroyed at the end of the full-expression in which they are created and in the reverse order of the completion of their construction.
Is this difference intentional? May temporaries in expressions other than those initializing references be deleted in non-LIFO order?
History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2008-03-17 00:00:00adminsetmessages: + msg1627
2008-03-17 00:00:00adminsetmessages: + msg1626
2008-02-03 00:00:00adminsetstatus: open -> wp
2000-05-21 00:00:00adminsetmessages: + msg358
2000-01-27 00:00:00admincreate