Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
count_if
Description

A metafunction that returns the result type of count_if given the sequence and predicate types.

Synopsis
template<
    typename Sequence,
    typename Pred
    >
struct count_if
{
    typedef int type;
};

Table 1.65. Parameters

Parameter

Requirement

Description

Sequence

A model of Forward Sequence

Operation's argument

Pred

A unary function object

Operation's argument


Expression Semantics
result_of::count_if<Sequence, Pred>::type

Return type: int.

Semantics: Returns the return type of count_if. The return type is always int.

Complexity

Constant.

Header
#include <boost/fusion/algorithm/query/count_if.hpp>
#include <boost/fusion/include/count_if.hpp>

PrevUpHomeNext