2 ms·
Throwing move is super weird too. I believe that it was a mistake to not treat user move like C++11 destructors and default to noexcept(true) on them. But it
by beached_whale 9mo ago
Throwing move is super weird too. I believe that it was a mistake to not treat user move like C++11 destructors and default to noexcept(true) on them. But it is what it is.
On the other hand, writing special member functions at all(move & copy constructor/assignment, destructor) is a smell for types that don't just manage the lifetime of an object(unique_ptr like things). People should not generally be writing them and being open to the mistake of getting noexcept wrong.
- locknitpicker 9mo ago> Throwing move is super weird too. I believe that it was a mistake to not treat user move like C++11 destructors and default to noexcept(true) on them. But it is what it is. I think you're missing a fair deal of insight into the issue. The move semantics proposal documents this aspect in clear and unambiguous terms: - Almost any class should be able to create a nothrow move assignment operator. - a basic requirement is that a class must have a valid resource less state (i.e., remain in a valid state after having been moved) - those that can't, shouldn't define move semantics.