http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48848

--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-03 
10:44:41 UTC ---
I'm also thinking that in terms of complexity, in this entire discussion we are
just shuffling work around in time. In LWG 675 it is established that clearing
first increases the complexity from constant to linear because the destructors
are called immediately, but sooner or later those destructors would have run
anyway, eh! On the other hand, calling the destructors immediately has the
advantage that we know all the resources owned by *this are released *now*. I'm
not sure we have an exact equivalent of that for valarray, outside resize(0) or
just some user-invisible implementation details. I'm coming to the conclusion
that, barring a clarification from the Committee, the straightforward thing to
do is just swapping the data members, the destructors of the temporarie will
run when they want, the move-assignment itself is certainly fast and nothrow,
as the FDIS wants.

Reply via email to