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 master branch, built from commit e83975fcee.
PrevUpHomeNext

Composing Concepts

(For the source of the examples in this section see compose.cpp)

Multiple concepts can be composed using an MPL sequence.

template<class T = _self>
struct arithmetic :
    mpl::vector<
        copy_constructible<T>,
        addable<T>,
        subtractable<T>,
        multipliable<T>,
        dividable<T>,
        equality_comparable<T>,
        less_than_comparable<T>
    >
{};

Now, arithmetic is a concept that can be used just like any of the base concepts.


PrevUpHomeNext