std::is_nothrow_copy_constructible in C++ with Examples Last Updated : 15 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The std::is_nothrow_copy_constructible template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_copy_constructible template of C++ STL is used to check whether T is copy constructible type or not and this is known for not to throw any exception. It return the boolean value true if T is copy constructible type, otherwise return false. Header File: #include<type_traits> Template Class: template <class T> struct is_nothrow_copy_constructible Syntax: is_nothrow_copy_constructible<T>::value Parameter: The template std::is_nothrow_copy_constructible accepts a single parameter T(Trait class) to check whether T is copy constructible type or not. Return Value: The template std::is_nothrow_copy_constructible returns a boolean variable as shown below: True: If type T is a copy constructible type. False: If type T is not a copy constructible type. Below is the program to demonstrate std::is_nothrow_copy_constructible in C++: Program 1: CPP // C++ program to illustrate // std::is_nothrow_copy_constructible #include <bits/stdc++.h> #include <type_traits> using namespace std; // Define Classes class X { }; class Y { Y(const Y&) {} }; // Driver Code int main() { cout << boolalpha; // Check if int is no throw copy // constructible cout << "int: " << is_nothrow_copy_constructible<int>::value << endl; // Check if class X is no throw copy // constructible cout << "class X: " << is_nothrow_copy_constructible<X>::value << endl; // Check if class Y is no throw copy // constructible cout << "class Y: " << is_nothrow_copy_constructible<Y>::value << endl; return 0; } Output: int: true class X: true class Y: false Program 2: CPP // C++ program to illustrate // std::is_nothrow_copy_constructible #include <iostream> #include <type_traits> using namespace std; // Declare structures struct A { }; struct B { B(const B&) {} }; struct C { C(const C&) noexcept {} }; // Driver Code int main() { cout << boolalpha; cout << "is_nothrow_copy_constructible:" << endl; cout << "int is_nothrow_copy_constructible? " << is_nothrow_copy_constructible<int>::value << endl; cout << "A is_nothrow_copy_constructible? " << is_nothrow_copy_constructible<A>::value << endl; cout << "B is_nothrow_copy_constructible? " << is_nothrow_copy_constructible<B>::value << endl; cout << "C is_nothrow_copy_constructible? " << is_nothrow_copy_constructible<C>::value << endl; return 0; } Output: is_nothrow_copy_constructible: int is_nothrow_copy_constructible? true A is_nothrow_copy_constructible? true B is_nothrow_copy_constructible? false C is_nothrow_copy_constructible? true Reference: https://cplusplus.com/reference/type_traits/is_nothrow_copy_constructible/ Comment More infoAdvertise with us Next Article std::is_nothrow_destructible in C++ with Examples B bansal_rtk_ Follow Improve Article Tags : Misc C++ CPP-Functions Practice Tags : CPPMisc Similar Reads std::is_nothrow_constructible in C++ with Examples The std::is_nothrow_constructible template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_constructible template of C++ STL is used to check whether the given type T is constructible type with the set of arguments or not and this is known for not to throw any excep 2 min read std::is_copy_constructible in C++ with Examples The std::is_copy_constructible template of C++ STL is present in the <type_traits> header file. The std::is_copy_constructible template of C++ STL is used to check whether the T is copy constructible or not. It return the boolean value true if T is copy constructible type, Otherwise return fal 2 min read std::is_nothrow_default_constructible in C++ with Examples The std::is_nothrow_default_constructible template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_default_constructible template of C++ STL is used to check whether the given type T is default constructible type or not and this is known for not to throw any excepti 2 min read std::is_nothrow_destructible in C++ with Examples The std::is_nothrow_destructible template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_denstructible template of C++ STL is used to check whether T is destructible type or not and this is known for not to throw any exception. It return the boolean value true if T 3 min read std::is_nothrow_move_constructible in C++ with Example The std::is_nothrow_move_constructible template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_move_constructible template of C++ STL is used to check whether the given type T T is move constructibe or not and this is known for not to throw any exception. It return 2 min read std::is_move_constructible in C++ with Examples The std::is_move_constructible template of C++ STL is present in the <type_traits> header file. The std::is_move_constructible template of C++ STL is used to check whether the T is move constructible (that can be constructed from an rvalue reference of its type) or not. It returns the boolean 2 min read Like