[#mp_units-contains-01b]
= xref:mp_units.adoc[mp&lowbar;units]::contains
:relfileprefix: ../
:mrdocs:

`contains` overloads

== Synopses

Declared in `&lt;mp&hyphen;units&sol;ext&sol;type&lowbar;traits&period;h&gt;`

Checks whether the type `T` matches the type of any of the non&hyphen;type template arguments `Vs`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    auto Vs&period;&period;&period;&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/contains-0c8.adoc[contains]();
----

[.small]#xref:mp_units/contains-0c8.adoc[_» more&period;&period;&period;_]#

Checks whether any of the types `Ts` is a specialization of the class template `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;typename&period;&period;&period;&gt; typename T,
    typename&period;&period;&period; Ts&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/contains-01e.adoc[contains]();
----

[.small]#xref:mp_units/contains-01e.adoc[_» more&period;&period;&period;_]#

Checks whether any of the types `Ts` is a specialization of the class template `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;auto&period;&period;&period;&gt; typename T,
    typename&period;&period;&period; Ts&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/contains-0c1.adoc[contains]();
----

[.small]#xref:mp_units/contains-0c1.adoc[_» more&period;&period;&period;_]#

Checks whether the type `T` is present in the type pack `T1, Ts&period;&period;&period;`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename T1,
    typename&period;&period;&period; Ts&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/contains-0b.adoc[contains]();
----

[.small]#xref:mp_units/contains-0b.adoc[_» more&period;&period;&period;_]#

== Return Value

* `true` if `T` matches the type of at least one of `Vs`, `false` otherwise
* `true` if at least one of `Ts` is a specialization of `T`, `false` otherwise
* `true` if `T` is the same as `T1` or one of `Ts`, `false` otherwise

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *T*
| The type to look for among the types of `Vs`
| *Vs*
| The non&hyphen;type template arguments whose types are checked against `T`
| *Ts*
| The types to check
| *T1*
| The first type of the pack to search
|===


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