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 a snapshot of the develop branch, built from commit 89872211d7.
PrevUpHomeNext
grammar::lut_chars::lut_chars (3 of 3 overloads)

Constructor.

Synopsis
template<
    class Pred>
constexpr
lut_chars(
    Pred const& pred);
Description

This function constructs a character set which has as members, every value of char ch for which the expression pred(ch) returns true.

Example
struct is_digit
{
    constexpr bool
    operator()( char c ) const noexcept
    {
        return c >= '0' && c <= '9' ;
    }
};

constexpr lut_chars digits( is_digit{} );
Complexity

Linear in pred, or constant if pred(ch) is a constant expression.

Exception Safety

Throws nothing.

Parameters

Name

Description

pred

The function object to use for determining membership in the character set.


PrevUpHomeNext