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 an older version of Boost and was released in 2013. The current version is 1.91.0.
boost::proto::otherwise —
Syntactic sugar for proto::when< proto::_, Fun >,
for use in grammars to handle all the cases not yet handled.
template<typename Fun> struct otherwise : proto::when< proto::_, Fun > { };
Use proto::otherwise<T> in your grammars as a synonym for
proto::when< proto::_, Fun >
as in the following transform which counts the number of terminals in an expression.
// Count the terminals in an expression tree.
// Must be invoked with initial state == mpl::int_<0>().
struct CountLeaves :
proto::or_<
proto::when<proto::terminal<proto::_>, mpl::next<proto::_state>()>,
proto::otherwise<proto::fold<proto::_, proto::_state, CountLeaves> >
>
{};