[Development] What's the status of a moved-from object?

Thiago Macieira thiago.macieira at intel.com
Tue May 21 06:29:04 CEST 2019


On Monday, 20 May 2019 12:05:58 PDT Allan Sandfeld Jensen wrote:
> I agree. I would consider anything other than deleting or reassigning  a
> moved object undefined behavior, so asserting on it seems like a good help
> to users of our APIs.

I agree, but we should leave this as a fallback case, albeit legitimate and 
not too difficult to justify. Here are a couple justifications:

- allocating memory (violates noexcept)
- retaining unknown quantities of memory (in the case of the assignment op)
- complex or slow code
- pessimises code elsewhere

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products






More information about the Development mailing list