This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: RFC: Allow moved-from strings to be non-empty


The reason move constructors were introduced was to speed up code in cases where an object
Is copied and the copy is no longer needed.  It is unfortunate that there may now be code out
there that relies on accidental properties of library implementations.  It would be best if the
Implementation is not constrained.  Unless the standard mandates that, after a string is moved,
the string is empty, the user should only be able to assume that it is in some consistent but
unspecified state.  Otherwise we pay a performance penalty forever. 

If the standard explicitly states that the argument to the move constructor is defined to be
empty after the call, we're stuck.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]