Opened 9 years ago

Closed 9 years ago

#8802 closed Feature Requests (fixed)

Add is_copy_constructible<T> trait

Reported by: Antony Polukhin Owned by: Antony Polukhin
Milestone: Boost 1.55.0 Component: type_traits
Version: Boost 1.54.0 Severity: Problem
Keywords: has_copy_constructor is_copy_constructible move traits Cc:

Description

Add an implementation of is_copy_constructible<T> trait. It must work with C++11 and in C++03 it must detect constructors assuming that if type is derived from boost::noncopyable or uses BOOST_MOVABLE_BUT_NOT_COPYABLE macro - it has no copy constructor.

Boost.Move requires the following patch applied to to BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN in boost/move/core.hpp :

#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
   #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
      private:\
      TYPE(TYPE &);\
      TYPE& operator=(TYPE &);\
+      public: \
+      typedef int boost_move_no_copy_constructor_or_assign; \
+      private: \
   //
#else

Change History (12)

comment:1 by Antony Polukhin, 9 years ago

Owner: changed from John Maddock to Antony Polukhin
Status: newassigned

comment:2 by Antony Polukhin, 9 years ago

(In [84987]) Added is_copy_constructible triat implementation and tests (refs #8802)

comment:3 by Antony Polukhin, 9 years ago

(In [85002]) Improvemants for is_copy_constructible triat (refs #8802):

  • Added small in-place documentation for trait
  • Trait is now included by boost/type_traits.hpp header
  • Added qbk documentation
  • Documentation regenerated

comment:4 by Antony Polukhin, 9 years ago

(In [85006]) Fix tests build under MSVC for is_copy_constructible triat (refs #8802)

comment:5 by Antony Polukhin, 9 years ago

(In [85060]) Fix tests for is_copy_constructible triat and fix reference-to-reference issue (refs #8802).

comment:6 by Antony Polukhin, 9 years ago

(In [85104]) Unify behavior of is_copy_constructible triat when dealing with rvalues + add comments for some tests (refs #8802):

comment:7 by Antony Polukhin, 9 years ago

(In [85173]) Workaround some of the Intel warinings/bugs in the is_copy_constructible_tests file (refs #8802)

comment:8 by Antony Polukhin, 9 years ago

(In [85193]) Test is_copy_constructible trait on C++03/98 with Boost.Move emulation of noncopyable-movable type (refs #8802, refs #8842)

comment:9 by Antony Polukhin, 9 years ago

(In [85222]) Atempt to workaround Intel issue with SFINAE (refs #8802)

comment:10 by Antony Polukhin, 9 years ago

(In [85319]) Intel compiler: do not use SFINAE with decltype/sizeof on deleted functions. Use fallback mode instead (refs #8802)

comment:11 by Antony Polukhin, 9 years ago

(In [85357]) Disable tests that can not be passed by intel compiler due to its usege of the is_copy_constructible trait in C++98/fallback mode (beacause of the bugs in SFINAE for deleted functions). (refs #8802)

comment:12 by Antony Polukhin, 9 years ago

Resolution: fixed
Status: assignedclosed

This issue was fixed in 1.55

Note: See TracTickets for help on using tickets.