3rdParty/boost/1.78.0/libs/mpl/doc/src/refmanual/contains.rst
.. Algorithms/Querying Algorithms//contains |30
.. parsed-literal::
template<
typename Sequence
, typename T
>
struct contains
{
typedef |unspecified| type;
};
Returns a true-valued |Integral Constant| if one or more elements in Sequence
are identical to T.
.. parsed-literal::
#include <boost/mpl/contains.hpp>
+---------------+---------------------------+-----------------------------------+
| Parameter | Requirement | Description |
+===============+===========================+===================================+
| Sequence | |Forward Sequence| | A sequence to be examined. |
+---------------+---------------------------+-----------------------------------+
| T | Any type | A type to search for. |
+---------------+---------------------------+-----------------------------------+
For any |Forward Sequence| s and arbitrary type t:
.. parsed-literal::
typedef contains<s,t>::type r;
:Return type: |Integral Constant|.
:Semantics: Equivalent to
.. parsed-literal::
typedef not_< is_same<
find<s,t>::type
, end<s>::type
> >::type r;
Linear. At most size<s>::value comparisons for identity.
.. parsed-literal::
typedef vector<char,int,unsigned,long,unsigned long> types;
BOOST_MPL_ASSERT_NOT(( contains<types,bool> ));
|Querying Algorithms|, |find|, |find_if|, |count|, |lower_bound|
.. copyright:: Copyright 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)