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

C&plus;&plus;11 `conditional` meta&hyphen;function&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;
----

== Description

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;

== 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-0f.adoc[`conditional&lt;false, t&lowbar;TRUE&lowbar;TYPE, t&lowbar;FALSE&lowbar;TYPE&gt;`] 
| Partial specialization of `bsl&colon;&colon;conditional` for a false condition&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/ManagedPtr_FactoryDeleterType.adoc[`ManagedPtr&lowbar;FactoryDeleterType`] 
| Metafunction selecting the preferred factory deleter for `ManagedPtr`&period;
|===


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