[#BloombergLP-bslstl-Variant_TypeToIndexImpl-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Variant&lowbar;TypeToIndexImpl
:relfileprefix: ../../
:mrdocs:

This component&hyphen;private metafunction provides implementation for `Variant&lowbar;TypeToIndex`&period; It evaluates to `t&lowbar;INDEX &plus; i` where `i` is the zero&hyphen;based index of (template parameter) `t&lowbar;TYPE` in (template parameters) `t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;`, or `bsl&colon;&colon;variant&lowbar;npos` if `t&lowbar;TYPE` is not found&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    size&lowbar;t t&lowbar;INDEX,
    class t&lowbar;TYPE,
    class t&lowbar;HEAD = BSLSTL&lowbar;VARIANT&lowbar;NOT&lowbar;A&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;TAIL&gt;
struct Variant&lowbar;TypeToIndexImpl
    : bsl::conditional&lt;bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;TYPE, t&lowbar;HEAD&gt;&colon;&colon;value, bsl::integral&lowbar;constant&lt;size&lowbar;t, t&lowbar;INDEX&gt;, Variant&lowbar;TypeToIndexImpl&lt;t&lowbar;INDEX &plus; 1, t&lowbar;TYPE, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `bsl::conditional&lt;bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;TYPE, t&lowbar;HEAD&gt;&colon;&colon;value, bsl::integral&lowbar;constant&lt;size&lowbar;t, t&lowbar;INDEX&gt;, Variant&lowbar;TypeToIndexImpl&lt;t&lowbar;INDEX &plus; 1, t&lowbar;TYPE, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type`
| 
|===

== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Variant_TypeToIndexImpl-07.adoc[`Variant&lowbar;TypeToIndexImpl&lt;t&lowbar;INDEX, t&lowbar;TYPE, BSLSTL&lowbar;VARIANT&lowbar;NOT&lowbar;A&lowbar;TYPE&gt;`] 
| This partial specialization is used when the list of alternatives `t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;` is empty, i&period;e&period;, `t&lowbar;TYPE` wasn&apos;t found in the originally supplied list of alternatives&period;
|===


== Derived Classes

[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;`] 
| 
|===


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