Bug #3414
closedstd::is_move_constructible<T> does not guarantee that T has a move constructor
100%
Description
Because a copy constructor in the form T(T)
or T(const T&)
will also bind to an rvalue argument, thus satisfying is_move_constructible<T>
without requiring the existence of a move constructor T(T&&)
.
Obviously the same applies to the _trivially_
and _nothrow_
variants, and a similar limitation applies to is_move_assignable
(doesn't guarantee that the type has a move assignment operator) and to its variants.
In ndn-cxx we currently use these type traits paired with static_assert
in Block
and Buffer
, but as explained above this is not sufficient to ensure that they have a move constructor or a move assignment operator.
Updated by Davide Pesavento almost 9 years ago
- Description updated (diff)
What we should do is deleting the pointless static asserts and explicitly declare the move constructor/assignment operator for those types (possibly defaulting them in the implementation, i.e. outside the class definition).
Updated by Davide Pesavento about 7 years ago
- Priority changed from Normal to Low
- Target version deleted (
v0.5)
Updated by Davide Pesavento over 6 years ago
- Status changed from New to In Progress
- Assignee set to Davide Pesavento
- Target version set to v0.7
Updated by Davide Pesavento over 6 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Davide Pesavento over 6 years ago
- Status changed from Code review to Closed