[#bsl-holds_alternative]
= xref:bsl.adoc[bsl]::holds&lowbar;alternative
:relfileprefix: ../
:mrdocs:

Return `true` if the specified `obj` currently holds the (template parameter) `t&lowbar;TYPE` alternative, and `false` otherwise&period; `t&lowbar;TYPE` shall appear exactly once in the variant&apos;s list of alternatives&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;variant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
bool
holds&lowbar;alternative(xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const& obj) noexcept;
----


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