[#bsl-conditional-0c]
= xref:bsl.adoc[bsl]::conditional
:relfileprefix: ../
:mrdocs:

This `struct` template implements the `conditional` meta&hyphen;function defined in the C&plus;&plus; standard &lsqb;meta&period;trans&period;other&rsqb;, providing an alias, `type`, that returns the result&period; If the (template parameter) value `t&lowbar;COND` is `true`, then `type` has the same type as the (template parameter) type `t&lowbar;TRUE&lowbar;TYPE`&semi; otherwise, `type` has the same type as the (template parameter) type `t&lowbar;FALSE&lowbar;TYPE`&period; Note that this generic default template defines `type` to be an alias to `t&lowbar;TRUE&lowbar;TYPE` for when `t&lowbar;COND` is `true`&period; A template specialization is provided (below) handles the case for when `t&lowbar;COND` is `false`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    bool t&lowbar;COND,
    class t&lowbar;TRUE&lowbar;TYPE,
    class t&lowbar;FALSE&lowbar;TYPE&gt;
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&lowbar;TRUE&lowbar;TYPE`&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:bsl/conditional-0b.adoc[`conditional&lt;false, PackedIntArrayImp&lt;PackedIntArrayImp&lowbar;Unsigned&gt;, PackedIntArrayImp&lt;PackedIntArrayImp&lowbar;Signed&gt;&gt;`] 
| This partial specialization of `bsl&colon;&colon;conditional`, for when the (template parameter) value `t&lowbar;COND` is `false`, provides a `typedef` `type` that is an alias to the (template parameter) type `t&lowbar;FALSE&lowbar;TYPE`&period;
| xref:bsl/conditional-0f.adoc[`conditional&lt;false, t&lowbar;TRUE&lowbar;TYPE, t&lowbar;FALSE&lowbar;TYPE&gt;`] 
| This partial specialization of `bsl&colon;&colon;conditional`, for when the (template parameter) value `t&lowbar;COND` is `false`, provides a `typedef` `type` that is an alias to the (template parameter) type `t&lowbar;FALSE&lowbar;TYPE`&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/ManagedPtr_FactoryDeleterType.adoc[`ManagedPtr&lowbar;FactoryDeleterType`] 
| This metafunction class&hyphen;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&period; The intent is to use a common deleter function for all allocators that implement the `bslma&colon;&colon;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`)&period;
|===


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