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 almost 9 years ago. Updated over 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 #1

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).

Actions #2

Updated by Davide Pesavento over 7 years ago

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

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
Actions #4

Updated by Davide Pesavento over 6 years ago

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

Updated by Davide Pesavento over 6 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF