[#bsl-holds_alternative] = xref:bsl.adoc[bsl]::holds_alternative :relfileprefix: ../ :mrdocs: Return `true` if `obj` currently holds the `t_TYPE` alternative. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> bool holds_alternative(xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const& obj) noexcept; ---- == Description Return `true` if the specified `obj` currently holds the (template parameter) `t_TYPE` alternative, and `false` otherwise. `t_TYPE` shall appear exactly once in the variant's list of alternatives. == Return Value `true` if `obj` holds the `t_TYPE` alternative == Parameters [cols="1,4"] |=== | Name| Description | *obj* | variant to query for the active alternative |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#