On Mon, Mar 02, 2009 at 12:16:42PM -0800, Mark Mitchell wrote:
> Ian Lance Taylor wrote:
> 
> > Daniel showed how this can fail for objects with internal pointers.
> > This includes __gnu_cxx::__vstring, which is likely to be the default
> > std::string class in libstdc++ 7, so this is not an unlikely occurrence.
> 
> The C++ standard limits the compiler's ability to introduce copies.  It
> says "Here are where copies occur; some of these can be optimized away."
>  It doesn't say anything about inserting more copies.  So, depending on
> exactly how this works, it might or might not be technically
> standard-conforming to introduce copies at this point.

On the other hand, the committee long ago endorsed the concept that
a copy constructor can be treated as simply making copies in some
contexts (e.g. named return value optimization), so to the extent
that this extends this, it is philosophically consistent (meaning
that eventually a future committee might well bless it).



Reply via email to