CARVIEW |
Select Language
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Sat, 19 Jul 2025 19:22:59 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Location: /reference/type_traits/is_copy_constructible/
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 19 Jul 2025 19:22:59 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"be51-bpNA6ca7OLPj/kX2jWpQCzhaAww"
Content-Encoding: gzip
Trait class that identifies whether T is a copy constructible type.
A copy constructible type is a type that can be constructed from a value or reference of the same type. This includes scalar types and copy constructible classes.
A copy constructible class is a class that has a copy constructor (either its implicit constructor or a custom defined one).
The is_copy_constructible class inherits from integral_constant as being either true_type or false_type, depending on whether T is copy constructible.
Output:
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<type_traits>
helper classes
-
false_typeC++11
-
integral_constantC++11
-
true_typeC++11
-
type traits
-
alignment_ofC++11
-
extentC++11
-
has_virtual_destructorC++11
-
is_abstractC++11
-
is_arithmeticC++11
-
is_arrayC++11
-
is_assignableC++11
-
is_base_ofC++11
-
is_classC++11
-
is_compoundC++11
-
is_constC++11
-
is_constructibleC++11
-
is_convertibleC++11
-
is_copy_assignableC++11
-
is_copy_constructibleC++11
-
is_default_constructibleC++11
-
is_destructibleC++11
-
is_emptyC++11
-
is_enumC++11
-
is_floating_pointC++11
-
is_functionC++11
-
is_fundamentalC++11
-
is_integralC++11
-
is_literal_typeC++11
-
is_lvalue_referenceC++11
-
is_member_function_pointerC++11
-
is_member_object_pointerC++11
-
is_member_pointerC++11
-
is_move_assignableC++11
-
is_move_constructibleC++11
-
is_nothrow_assignableC++11
-
is_nothrow_constructibleC++11
-
is_nothrow_copy_assignableC++11
-
is_nothrow_copy_constructibleC++11
-
is_nothrow_default_constructibleC++11
-
is_nothrow_destructibleC++11
-
is_nothrow_move_assignableC++11
-
is_nothrow_move_constructibleC++11
-
is_null_pointerC++14
-
is_objectC++11
-
is_podC++11
-
is_pointerC++11
-
is_polymorphicC++11
-
is_referenceC++11
-
is_rvalue_referenceC++11
-
is_sameC++11
-
is_scalarC++11
-
is_signedC++11
-
is_standard_layoutC++11
-
is_trivialC++11
-
is_trivially_assignableC++11
-
is_trivially_constructibleC++11
-
is_trivially_copy_assignableC++11
-
is_trivially_copy_constructibleC++11
-
is_trivially_copyableC++11
-
is_trivially_default_constructibleC++11
-
is_trivially_destructibleC++11
-
is_trivially_move_assignableC++11
-
is_trivially_move_constructibleC++11
-
is_unionC++11
-
is_unsignedC++11
-
is_voidC++11
-
is_volatileC++11
-
rankC++11
-
type transformations
-
add_constC++11
-
add_cvC++11
-
add_lvalue_referenceC++11
-
add_pointerC++11
-
add_rvalue_referenceC++11
-
add_volatileC++11
-
aligned_storageC++11
-
aligned_unionC++11
-
common_typeC++11
-
conditionalC++11
-
decayC++11
-
enable_ifC++11
-
make_signedC++11
-
make_unsignedC++11
-
remove_all_extentsC++11
-
remove_constC++11
-
remove_cvC++11
-
remove_extentC++11
-
remove_pointerC++11
-
remove_referenceC++11
-
remove_volatileC++11
-
result_ofC++11
-
underlying_typeC++11
-
- Reference
- <type_traits>
- is_copy_constructible
class template
<type_traits>
std::is_copy_constructible
template <class T> struct is_copy_constructible;
Is copy constructible
- integral_constant
- is_copy_constructible
Trait class that identifies whether T is a copy constructible type.
A copy constructible type is a type that can be constructed from a value or reference of the same type. This includes scalar types and copy constructible classes.
A copy constructible class is a class that has a copy constructor (either its implicit constructor or a custom defined one).
The is_copy_constructible class inherits from integral_constant as being either true_type or false_type, depending on whether T is copy constructible.
Template parameters
- T
- A complete type, or void (possible cv-qualified), or an array of unknown bound.
Member types
Inherited from integral_constant:member type | definition |
---|---|
value_type | bool |
type | either true_type or false_type |
Member constants
Inherited from integral_constant:member constant | definition |
---|---|
value | either true or false |
Member functions
Inherited from integral_constant:- operator bool
- Returns value (public member function)
Example
|
|
Output:
is_copy_constructible: int: true A: true B: false C: true |
See also
- is_constructible
- Is constructible (class template)
- is_trivially_copy_constructible
- Is trivially copy constructible (class template)
- is_default_constructible
- Is default constructible (class template)
- is_destructible
- Is destructible (class template)
- is_nothrow_copy_constructible
- Is copy constructible throwing no exceptions (class template)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us