[#bsl-is_empty] = xref:bsl.adoc[bsl]::is_empty :relfileprefix: ../ :mrdocs: Meta‐function for detecting empty class types. == Synopsis Declared in `<bslmf_isempty.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> struct is_empty : xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, ::std::is_empty<t_TYPE>::value>] ---- == Description This `struct` is a meta‐function to determine whether the (template parameter) `t_TYPE` is an empty class type. This `struct` derives from `bsl::true_type` if the `t_TYPE` is empty, and from `bsl::false_type` otherwise. This meta‐function has the same syntax as the `is_empty` meta‐function defined in the C++11 standard [meta.unary.prop]; on C++03 platforms, however, this meta‐function defaults to `true_type` if `t_TYPE` is a `class` or `struct` with no non‐static data members other than bit‐fields of length 0, no virtual member functions, no virtual base classes, and no base class `B` for which `is_empty<B>::value` is `false`; otherwise `is_empty` defaults to `false_type`. Note that this meta‐function will fail to compile for a union that is the same size as an empty class in C++03. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, ::std::is_empty<t_TYPE>::value>]` | Metafunction representing a compile‐time constant of the specified (template parameter) `t_TYPE` with the specified (template parameter) `t_VALUE`. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/type.adoc[`type`] | Alias for this `integral_constant` specialization. | xref:bsl/integral_constant-02/value_type.adoc[`value_type`] | Alias for the (template parameter) `t_TYPE`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/operator_call.adoc[`operator()`] | Return a copy of the template argument `t_VALUE`. | xref:bsl/integral_constant-02/2conversion.adoc[`operator t_TYPE`] | Return a copy of the template argument `t_VALUE`. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/value.adoc[`value`] | The compile‐time constant value of this metafunction. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/AllocatorTraits_IsAlwaysEqual-0a.adoc[`AllocatorTraits_IsAlwaysEqual<ALLOC, false>`] | Sets `is_always_equal` to `bsl::is_empty<ALLOC>` when not defined by `ALLOC`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#