2 Copyright 2007 John Maddock.
3 Copyright 2013 Antony Polukhin.
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt).
9 [section:is_copy_constructible is_copy_constructible]
12 struct is_copy_constructible : public __tof {};
14 __inherit If `T` is a (possibly cv-qualified) type with a copy constructor,
15 then inherits from __true_type, otherwise inherits from __false_type. Type `T`
16 must be a complete type.
18 In other words, inherits from __true_type only if copy constructor of `T` not
19 marked with `= delete`, `T` does not derives from `boost::noncopyable` and
20 does not marked with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`.
22 __compat This trait requires the C++11 features `decltype` and SFINAE-expression support for full support.
24 If your compiler does not support C++11 deleted functions (`= delete`) or does not support
25 SFINAE for the deleted constructors, then derive your classes from `boost::noncopyable` or
26 mark them with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)` to show that class is noncopyable.
28 The trait does not care about access modifiers, so if you see errors like this:
30 'T::T(const T&)' is private
31 boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context
33 then you are trying to call that macro for a structure with private constructor:
42 To fix that you must modify your structure, explicitly marking it as noncopyable (`= delete`,
43 `boost::noncopyable` or `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`) or explicitly
44 [link boost_typetraits.user_defined specialize trait].
47 __header ` #include <boost/type_traits/is_copy_constructible.hpp>` or ` #include <boost/type_traits.hpp>`