[#bsl-conditional-0c] = xref:bsl.adoc[bsl]::conditional :relfileprefix: ../ :mrdocs: This `struct` template implements the `conditional` meta‐function defined in the C++ standard [meta.trans.other], providing an alias, `type`, that returns the result. If the (template parameter) value `t_COND` is `true`, then `type` has the same type as the (template parameter) type `t_TRUE_TYPE`; otherwise, `type` has the same type as the (template parameter) type `t_FALSE_TYPE`. Note that this generic default template defines `type` to be an alias to `t_TRUE_TYPE` for when `t_COND` is `true`. A template specialization is provided (below) handles the case for when `t_COND` is `false`. == Synopsis Declared in `<bslmf_conditional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< bool t_COND, class t_TRUE_TYPE, class t_FALSE_TYPE> struct conditional; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/conditional-0c/type.adoc[`type`] | This `typedef` is an alias to the (template parameter) type `t_TRUE_TYPE`. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/conditional-0b.adoc[`conditional<false, PackedIntArrayImp<PackedIntArrayImp_Unsigned>, PackedIntArrayImp<PackedIntArrayImp_Signed>>`] | This partial specialization of `bsl::conditional`, for when the (template parameter) value `t_COND` is `false`, provides a `typedef` `type` that is an alias to the (template parameter) type `t_FALSE_TYPE`. | xref:bsl/conditional-0f.adoc[`conditional<false, t_TRUE_TYPE, t_FALSE_TYPE>`] | This partial specialization of `bsl::conditional`, for when the (template parameter) value `t_COND` is `false`, provides a `typedef` `type` that is an alias to the (template parameter) type `t_FALSE_TYPE`. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/ManagedPtr_FactoryDeleterType.adoc[`ManagedPtr_FactoryDeleterType`] | This metafunction class‐template provides a means to compute the preferred deleter function for a factory class for those methods of `ManagedPtr` that supply only a factory, and no additional deleter function. The intent is to use a common deleter function for all allocators that implement the `bslma::Allocator` protocol, rather than create a special deleter function based on the complete type of each allocator, each doing the same thing (invoking the virtual function `deleteObject`). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#