From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-11-18 10:43:33
"Aaron W. LaFramboise" <aaronrabiddog51_at_[hidden]> wrote in message
| David Abrahams wrote:
| > "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
| >>Here's my take on it: a compiler is allowed to a remove any copy
| >>long as the programs observed behavior is the
| >>same. AFAICT, copying (or assigning) a vector<int> (compared to not doing
| >>will never change the observed behavior.
| > You're kidding, right?
I wasn't :-)
| > I doubt very much that the compiler can
| > legitimately decide that side effects on the memory subsystem due to
| > allocation are not observable.
| This came up on the GCC lists a while back
Reading through that thread, I think must be dependent on how we define
"observable behavior". Including the
memory system as observable is wierd IMO...just the fact that there are no
other portable guarantees of memory layout/memory manager
suggest that making 2 instead of 1 heap-allocations cannot be what we mean by
So the example from the gcc-thread,
should easily be allowed to be removed.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk