Composing Concepts

| Home | Libraries | People | FAQ | More

## 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.