[#BloombergLP-bslstl-Variant_TypeToIndex-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Variant&lowbar;TypeToIndex
:relfileprefix: ../../
:mrdocs:

Compute the zero&hyphen;based index of `t&lowbar;TYPE` in `t&lowbar;VARIANT`&apos;s 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;VARIANT&gt;
struct Variant&lowbar;TypeToIndex;
----

== Description

This component&hyphen;private metafunction calculates the zero&hyphen;based index of (template parameter) `t&lowbar;TYPE` in the list of alternatives in (template parameter) `t&lowbar;VARIANT`, or `bsl&colon;&colon;variant&lowbar;npos` if there is no such alternative&period;

The primary template (used when `t&lowbar;VARIANT` is not a `bsl&colon;&colon;variant`) is not defined&period;

== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Variant_TypeToIndex-00.adoc[`Variant&lowbar;TypeToIndex&lt;t&lowbar;TYPE, bsl::variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;`] 
| Compute the zero&hyphen;based index of `t&lowbar;TYPE` in a `bsl&colon;&colon;variant`&period;
|===



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