[#BloombergLP-bslmf-EnableIf-0e4] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmf.adoc[bslmf]::EnableIf :relfileprefix: ../../ :mrdocs: This `struct` template implements a meta‐function that provides a `typedef` `type` that is an alias to the (template parameter) `t_TYPE` if the (template parameter) `t_COND` is `true`; otherwise, `type` is not provided. If `t_TYPE` is not specified, it is set to `void`. Note that this generic default template provides `type` for when `t_COND` is `true`; a template specialization is provided (below) that omits `type` for when `t_COND` is `false`. == Synopsis Declared in `<bslmf_enableif.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< bool t_COND, class t_TYPE = void> struct EnableIf; ---- == Description Also note that although this `struct` is functionally identical to `bsl::enable_if`, the use of `bsl::enable_if` should be preferred. == 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_TYPE`. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmf/EnableIf-0e8.adoc[`EnableIf<false, t_TYPE>`] | This partial specialization of `EnableIf`, for when the (template parameter) `t_COND` is `false`, guarantees that no `typedef` `type` is supplied. Note that this class definition is intentionally empty. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#