[#BloombergLP-bdlb-VariantImp-typeIndex]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp]::typeIndex
:relfileprefix: ../../../
:mrdocs:

Return the 1&hyphen;based index of the held type, or 0 if unset&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
typeIndex() const;
----

== Description

Note that instead of switching code on the type index, calling `apply` is the preferred method of manipulating different types stored inside a variant&period;

== Return Value

the 1&hyphen;based index of the held type, or 0 if unset


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