Project

General

Profile

Actions

Bug #3414

closed

std::is_move_constructible<T> does not guarantee that T has a move constructor

Added by Davide Pesavento over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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.

Actions

Also available in: Atom PDF