Back to Arangodb

count

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/count.html

3.12.9.12.3 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Querying Algorithms / count |

count

Synopsis

template<
      typename Sequence
    , typename T
    >
struct[count](./count.html){
    typedef_unspecified_type;
};

Description

Returns the number of elements in a Sequence that are identical to T.

#include <[boost/mpl/count.hpp](../../../../boost/mpl/count.hpp)>

Parameters

ParameterRequirementDescription
SequenceForward SequenceA sequence to be examined.
TAny typeA type to search for.

Expression semantics

For any Forward Sequence s and arbitrary type t:

typedef[count](./count.html)<s,t>::type n;

| Return type: |

Integral Constant.

| | Semantics: |

Equivalent to

typedef[count\_if](./count-if.html)< s,is_same<_,T> >::type n;

|

Complexity

Linear. Exactly size<s>::value comparisons for identity.

Example

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 );

See also

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) |