[#BloombergLP-bslstl-Variant_ConvertIndex]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Variant&lowbar;ConvertIndex
:relfileprefix: ../../
:mrdocs:

Compute the index of the unique best&hyphen;match alternative, or `npos`&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;ConvertIndex
    : Variant&lowbar;OverloadHelper&lt;t&lowbar;TYPE, t&lowbar;VARIANT&gt;::Index
----

== Description

This component&hyphen;private metafunction computes the index of the alternative in (template parameter) `t&lowbar;VARIANT` that is the &quot;unique&quot; best match for conversion from `std&colon;&colon;declval&lt;t&lowbar;TYPE&gt;()`, or `bsl&colon;&colon;variant&lowbar;npos` if there is no such alternative&period;

An alternative that occurs multiple times in `t&lowbar;VARIANT` (possibly with varying cv&hyphen;qualifications) is considered to occur only once&semi; thus, if all alternatives that are tied for the best match are the same type (possibly with varying cv&hyphen;qualifications), the result is the lowest index at which that type (with any cv&hyphen;qualification) occurs&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `Variant&lowbar;OverloadHelper&lt;t&lowbar;TYPE, t&lowbar;VARIANT&gt;::Index`
| 
|===


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