[#BloombergLP-bslalg-SelectTrait]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::SelectTrait
:relfileprefix: ../../
:mrdocs:

Meta&hyphen;function that selects the first matching trait for a type&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;selecttrait&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class TRAIT1,
    class TRAIT2 = xref:BloombergLP/bslalg/TypeTraitNil.adoc[TypeTraitNil],
    class TRAIT3 = xref:BloombergLP/bslalg/TypeTraitNil.adoc[TypeTraitNil],
    class TRAIT4 = xref:BloombergLP/bslalg/TypeTraitNil.adoc[TypeTraitNil],
    class TRAIT5 = xref:BloombergLP/bslalg/TypeTraitNil.adoc[TypeTraitNil]&gt;
struct SelectTrait;
----

== Description

Select one trait out of several that the parameterized type `T` may possess&period; If `T` has the parameterized trait `TRAIT1`, then the nested `Type` is `TRAIT1`, else if `T` has an optionally parameterized `TRAIT2`, then `Type` is `TRAIT2`, etc&period; Also computes an integral selection constant and meta&hyphen;value&period; If `T` has none of the parameterized `TRAIT&ast;`, then the nested `Type` is `TypeTraitNil`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/SelectTrait/Type.adoc[`Type`] 
| The actual trait that was selected, or `TypeTraitNil` if no trait was selected&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/SelectTrait/_04enum.adoc[`Unnamed enum`] 
| Compile&hyphen;time selection index for the chosen trait&period;
|===



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