C++ 中的 std::is_nothrow_copy_constructible 示例
C++ STL 中的 std::is_nothrow_copy_constructible 模板位于 **
头文件:
模板类:
语法:
参数: 模板 std::is_nothrow_copy_constructible 接受一个参数 T(Trait类) ,以检查 T 是否为可以复制构造的类型。
返回值: 模板 std::is_nothrow_copy_constructible 将返回布尔变量,如下所示:
- True: 如果类型 T 是可以复制构造的类型。
- False: 如果类型 T 不是可以复制构造的类型。
以下是C++中演示 std::is_nothrow_copy_constructible 的程序:
程序1:
程序2:
参考资料: http://www.cplusplus.com/reference/type_traits/is_nothrow_copy_constructible/