[#bsl-is_trivially_copyable-044] = xref:bsl.adoc[bsl]::is_trivially_copyable :relfileprefix: ../ :mrdocs: This `struct` template implements a meta‐function to determine whether the (template parameter) `t_TYPE` is trivially copyable. This `struct` derives from `bsl::true_type` if the `t_TYPE` is trivially copyable, and from `bsl::false_type` otherwise. This meta‐function has the same syntax as the `is_trivially_copyable` meta‐function defined in the C++11 standard [meta.unary.prop]; however, this meta‐function can automatically determine the value for the following types only: reference types, fundamental types, enumerated types, pointers to members, and types declared to have the `bsl::is_trivially_copyable` trait using the `BSLMF_NESTED_TRAIT_DECLARATION` macro (the value for other types defaults to `false`). To support other trivially copyable types, this template must be specialized to inherit from `bsl::true_type` for them. == Synopsis Declared in `<bslmf_istriviallycopyable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> struct is_trivially_copyable : BloombergLP::bslmf::IsTriviallyCopyable_Intrinsic<t_TYPE>::type ---- == Base Classes [cols="1,4"] |=== | Name| Description | `BloombergLP::bslmf::IsTriviallyCopyable_Intrinsic<t_TYPE>::type` | |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/is_trivially_copyable-0c.adoc[`is_trivially_copyable<BloombergLP::bsls::TimeInterval>`] | This template specialization for `is_trivially_copyable` indicates that `TimeInterval` is a trivially copyable type. | xref:bsl/is_trivially_copyable-09.adoc[`is_trivially_copyable<owner_equal>`] | | xref:bsl/is_trivially_copyable-0d1.adoc[`is_trivially_copyable<owner_hash>`] | | xref:bsl/is_trivially_copyable-0a6.adoc[`is_trivially_copyable<type_index>`] | This template specialization for `is_trivially_copyable` indicates that `type_index` is a trivially copyable type. Note that this explicit specialization is needed only for C++98/03 compilers, as the C++11 trait will implicitly deduce triviality. | xref:bsl/is_trivially_copyable-02.adoc[`is_trivially_copyable<hash<TYPE>>`] | | xref:bsl/is_trivially_copyable-0beed.adoc[`is_trivially_copyable<owner_less<POINTER_TYPE>>`] | | xref:bsl/is_trivially_copyable-0f.adoc[`is_trivially_copyable<t_TYPE volatile>`] | This partial specialization ensures that volatile‐qualified types have the same result as their element type. | xref:bsl/is_trivially_copyable-0dd.adoc[`is_trivially_copyable<t_TYPE const>`] | This partial specialization ensures that const‐qualified types have the same result as their element type. | xref:bsl/is_trivially_copyable-03.adoc[`is_trivially_copyable<t_TYPE const volatile>`] | This partial specialization ensures that const‐volatile‐qualified types have the same result as their element type. | xref:bsl/is_trivially_copyable-065.adoc[`is_trivially_copyable<t_TYPE&>`] | This partial specialization optimizes away a number of nested template instantiations to prove that reference types are never trivially copyable. | xref:bsl/is_trivially_copyable-0dc.adoc[`is_trivially_copyable<t_TYPE&&>`] | This partial specialization optimizes away a number of nested template instantiations to prove that reference types are never trivially copyable. | xref:bsl/is_trivially_copyable-067.adoc[`is_trivially_copyable<t_TYPE[]>`] | This partial specialization ensures that array‐of‐unknown‐bound types have the same result as their element type. | xref:bsl/is_trivially_copyable-04e.adoc[`is_trivially_copyable<t_TYPE volatile[]>`] | This partial specialization ensures that volatile‐qualified array‐of‐unknown‐bound types have the same result as their element type. | xref:bsl/is_trivially_copyable-0d3.adoc[`is_trivially_copyable<t_TYPE const[]>`] | This partial specialization ensures that const‐qualified array‐of‐unknown‐bound types have the same result as their element type. | xref:bsl/is_trivially_copyable-0ab.adoc[`is_trivially_copyable<t_TYPE const volatile[]>`] | This partial specialization ensures that const‐volatile‐qualified array‐of‐unknown‐bound types have the same result as their element type. | xref:bsl/is_trivially_copyable-0ac.adoc[`is_trivially_copyable<t_TYPE[]>`] | This partial specialization ensures that array types have the same result as their element type. | xref:bsl/is_trivially_copyable-01.adoc[`is_trivially_copyable<t_TYPE volatile[]>`] | This partial specialization ensures that volatile‐qualified array types have the same result as their element type. | xref:bsl/is_trivially_copyable-0bee3.adoc[`is_trivially_copyable<t_TYPE const[]>`] | This partial specialization ensures that const‐qualified array types have the same result as their element type. | xref:bsl/is_trivially_copyable-041.adoc[`is_trivially_copyable<t_TYPE const volatile[]>`] | This partial specialization ensures that const‐volatile‐qualified array types have the same result as their element type. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmf/IsTriviallyCopyableCheck.adoc[`IsTriviallyCopyableCheck`] | This `struct` exists to return the same value as `is_trivially_copyable` and is intended to never be specialized. The purpose of using it is to perform the following static assert that the `bsl` and `std` versions of `is_trivially_copyable` are in sync. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#