[#BloombergLP-bslstl-Variant_TypeToIndex-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_TypeToIndex-0d.adoc[Variant&lowbar;TypeToIndex]&lt;t&lowbar;TYPE, xref:bsl/variant.adoc[bsl::variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&gt;
:relfileprefix: ../../
:mrdocs:

Compute the zero&hyphen;based index of `t&lowbar;TYPE` in a `bsl&colon;&colon;variant`&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;
struct xref:BloombergLP/bslstl/Variant_TypeToIndex-0d.adoc[Variant&lowbar;TypeToIndex]&lt;t&lowbar;TYPE, xref:bsl/variant.adoc[bsl::variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&gt;
    : xref:BloombergLP/bslstl/Variant_TypeToIndexImpl-0a.adoc[Variant&lowbar;TypeToIndexImpl&lt;0, t&lowbar;TYPE, t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]
----

== Description

This partial specialization of `Variant&lowbar;TypeToIndex` computes the zero&hyphen;based index of `t&lowbar;TYPE` in the alternatives `t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;` of a `bsl&colon;&colon;variant` specialization&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bslstl/Variant_TypeToIndexImpl-0a.adoc[Variant&lowbar;TypeToIndexImpl&lt;0, t&lowbar;TYPE, t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]`
| Compute `t&lowbar;INDEX &plus; i` where `i` is the index of `t&lowbar;TYPE`, or `npos`&period;
|===


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