3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/count.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Querying Algorithms / count |
template<
typename Sequence
, typename T
>
struct[count](./count.html){
typedef_unspecified_type;
};
Returns the number of elements in a Sequence that are identical to T.
#include <[boost/mpl/count.hpp](../../../../boost/mpl/count.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:
typedef[count](./count.html)<s,t>::type n;
| Return type: |
| | Semantics: |
Equivalent to
typedef[count\_if](./count-if.html)< s,is_same<_,T> >::type n;
|
Linear. Exactly size<s>::value comparisons for identity.
typedef[vector](./vector.html)<int,char,long,short,char,short,double,long> types;
typedef[count](./count.html)<types, short>::type n;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( n::value, ==, 2 );
Querying Algorithms, count_if, find, find_if, contains, lower_bound
| Prev Next | Back Along | Up Home | Full TOC |
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) |