[#bsl-enable_if-07] = xref:bsl.adoc[bsl]::enable_if :relfileprefix: ../ :mrdocs: This `struct` template implements the `enable_if` meta‐function defined in the C++11 standard [meta.trans.ptr]. This `struct` template 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 enable_if; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/enable_if-07/type.adoc[`type`] | This `typedef` is an alias to the (template parameter) `t_TYPE`. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/enable_if-0b.adoc[`enable_if<true>`] | This `struct` template implements the `enable_if` meta‐function defined in the C++11 standard [meta.trans.ptr]. This `struct` template 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`. | xref:bsl/enable_if-08.adoc[`enable_if<false, t_TYPE>`] | This partial specialization of `enable_if`, 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]#