[#BloombergLP-bslmf-EnableIf-0e4]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmf.adoc[bslmf]::EnableIf
:relfileprefix: ../../
:mrdocs:

This `struct` template implements a meta&hyphen;function that provides a `typedef` `type` that is an alias to the (template parameter) `t&lowbar;TYPE` if the (template parameter) `t&lowbar;COND` is `true`&semi; otherwise, `type` is not provided&period; If `t&lowbar;TYPE` is not specified, it is set to `void`&period; Note that this generic default template provides `type` for when `t&lowbar;COND` is `true`&semi; a template specialization is provided (below) that omits `type` for when `t&lowbar;COND` is `false`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    bool t&lowbar;COND,
    class t&lowbar;TYPE = void&gt;
struct EnableIf;
----

== Description

Also note that although this `struct` is functionally identical to `bsl&colon;&colon;enable&lowbar;if`, the use of `bsl&colon;&colon;enable&lowbar;if` should be preferred&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmf/EnableIf-0e4/type.adoc[`type`] 
| This `typedef` is an alias to the (template parameter) `t&lowbar;TYPE`&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmf/EnableIf-0e8.adoc[`EnableIf&lt;false, t&lowbar;TYPE&gt;`] 
| This partial specialization of `EnableIf`, for when the (template parameter) `t&lowbar;COND` is `false`, guarantees that no `typedef` `type` is supplied&period; Note that this class definition is intentionally empty&period;
|===



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