Project

General

Profile

Bug #3414

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

Added by Davide Pesavento about 5 years ago. Updated over 2 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.

#1

Updated by Davide Pesavento about 5 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).

#2

Updated by Davide Pesavento over 3 years ago

  • Priority changed from Normal to Low
  • Target version deleted (v0.5)
#3

Updated by Davide Pesavento over 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Davide Pesavento
  • Target version set to v0.7
#4

Updated by Davide Pesavento over 2 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
#5

Updated by Davide Pesavento over 2 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF