[#bsl-is_trivially_copyable-044]
= xref:bsl.adoc[bsl]::is&lowbar;trivially&lowbar;copyable
:relfileprefix: ../
:mrdocs:

This `struct` template implements a meta&hyphen;function to determine whether the (template parameter) `t&lowbar;TYPE` is trivially copyable&period; This `struct` derives from `bsl&colon;&colon;true&lowbar;type` if the `t&lowbar;TYPE` is trivially copyable, and from `bsl&colon;&colon;false&lowbar;type` otherwise&period; This meta&hyphen;function has the same syntax as the `is&lowbar;trivially&lowbar;copyable` meta&hyphen;function defined in the C&plus;&plus;11 standard &lsqb;meta&period;unary&period;prop&rsqb;&semi; however, this meta&hyphen;function can automatically determine the value for the following types only&colon; reference types, fundamental types, enumerated types, pointers to members, and types declared to have the `bsl&colon;&colon;is&lowbar;trivially&lowbar;copyable` trait using the `BSLMF&lowbar;NESTED&lowbar;TRAIT&lowbar;DECLARATION` macro (the value for other types defaults to `false`)&period; To support other trivially copyable types, this template must be specialized to inherit from `bsl&colon;&colon;true&lowbar;type` for them&period;

== Synopsis

Declared in `&lt;bslmf&lowbar;istriviallycopyable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
struct is&lowbar;trivially&lowbar;copyable
    : BloombergLP::bslmf::IsTriviallyCopyable&lowbar;Intrinsic&lt;t&lowbar;TYPE&gt;::type
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `BloombergLP::bslmf::IsTriviallyCopyable&lowbar;Intrinsic&lt;t&lowbar;TYPE&gt;::type`
| 
|===

== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:bsl/is_trivially_copyable-0c.adoc[`is&lowbar;trivially&lowbar;copyable&lt;BloombergLP::bsls::TimeInterval&gt;`] 
| This template specialization for `is&lowbar;trivially&lowbar;copyable` indicates that `TimeInterval` is a trivially copyable type&period;
| xref:bsl/is_trivially_copyable-09.adoc[`is&lowbar;trivially&lowbar;copyable&lt;owner&lowbar;equal&gt;`] 
| 
| xref:bsl/is_trivially_copyable-0d1.adoc[`is&lowbar;trivially&lowbar;copyable&lt;owner&lowbar;hash&gt;`] 
| 
| xref:bsl/is_trivially_copyable-0a6.adoc[`is&lowbar;trivially&lowbar;copyable&lt;type&lowbar;index&gt;`] 
| This template specialization for `is&lowbar;trivially&lowbar;copyable` indicates that `type&lowbar;index` is a trivially copyable type&period; Note that this explicit specialization is needed only for C&plus;&plus;98&sol;03 compilers, as the C&plus;&plus;11 trait will implicitly deduce triviality&period;
| xref:bsl/is_trivially_copyable-02.adoc[`is&lowbar;trivially&lowbar;copyable&lt;hash&lt;TYPE&gt;&gt;`] 
| 
| xref:bsl/is_trivially_copyable-0beed.adoc[`is&lowbar;trivially&lowbar;copyable&lt;owner&lowbar;less&lt;POINTER&lowbar;TYPE&gt;&gt;`] 
| 
| xref:bsl/is_trivially_copyable-0f.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE volatile&gt;`] 
| This partial specialization ensures that volatile&hyphen;qualified types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-0dd.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const&gt;`] 
| This partial specialization ensures that const&hyphen;qualified types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-03.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const volatile&gt;`] 
| This partial specialization ensures that const&hyphen;volatile&hyphen;qualified types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-065.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE&&gt;`] 
| This partial specialization optimizes away a number of nested template instantiations to prove that reference types are never trivially copyable&period;
| xref:bsl/is_trivially_copyable-0dc.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE&&&gt;`] 
| This partial specialization optimizes away a number of nested template instantiations to prove that reference types are never trivially copyable&period;
| xref:bsl/is_trivially_copyable-067.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE[]&gt;`] 
| This partial specialization ensures that array&hyphen;of&hyphen;unknown&hyphen;bound types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-04e.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE volatile[]&gt;`] 
| This partial specialization ensures that volatile&hyphen;qualified array&hyphen;of&hyphen;unknown&hyphen;bound types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-0d3.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const[]&gt;`] 
| This partial specialization ensures that const&hyphen;qualified array&hyphen;of&hyphen;unknown&hyphen;bound types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-0ab.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const volatile[]&gt;`] 
| This partial specialization ensures that const&hyphen;volatile&hyphen;qualified array&hyphen;of&hyphen;unknown&hyphen;bound types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-0ac.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE[]&gt;`] 
| This partial specialization ensures that array types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-01.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE volatile[]&gt;`] 
| This partial specialization ensures that volatile&hyphen;qualified array types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-0bee3.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const[]&gt;`] 
| This partial specialization ensures that const&hyphen;qualified array types have the same result as their element type&period;
| xref:bsl/is_trivially_copyable-041.adoc[`is&lowbar;trivially&lowbar;copyable&lt;t&lowbar;TYPE const volatile[]&gt;`] 
| This partial specialization ensures that const&hyphen;volatile&hyphen;qualified array types have the same result as their element type&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmf/IsTriviallyCopyableCheck.adoc[`IsTriviallyCopyableCheck`] 
| This `struct` exists to return the same value as `is&lowbar;trivially&lowbar;copyable` and is intended to never be specialized&period; The purpose of using it is to perform the following static assert that the `bsl` and `std` versions of `is&lowbar;trivially&lowbar;copyable` are in sync&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
