[#BloombergLP-bdlb-VariantImp-typeIndex] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp]::typeIndex :relfileprefix: ../../../ :mrdocs: Return the index in the list of `TYPES` corresponding to the type of the value currently held by this variant object (starting at 1), or 0 if this object is unset. Note that instead of switching code on the type index, calling `apply` is the preferred method of manipulating different types stored inside a variant. == Synopsis Declared in `<bdlb_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int typeIndex() const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#