[#bsl-variant-index]
= xref:bsl.adoc[bsl]::xref:bsl/variant.adoc[variant]::index
:relfileprefix: ../../
:mrdocs:

Return the index of the alternative currently managed by this `variant` object, or `bsl&colon;&colon;variant&lowbar;npos` if this object is valueless by exception&period; This method differs from the standard in the following way&colon; &ast; `constexpr` is not implemented This is because no constructors are currently constexpr and there is no way to test the constexpr property of this function&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
index() const noexcept;
----


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