Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Struct template otherwise

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Reference

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

PrevUpHomeNext

Struct template otherwise

boost::proto::otherwise — Syntactic sugar for proto::when< proto::_, Fun >, for use in grammars to handle all the cases not yet handled.

Synopsis

// In header: <boost/proto/transform/when.hpp>
template<typename Fun> 
struct otherwise :  proto::when< proto::_, Fun > {
};

Description

Используйте proto::otherwise в ваших грамматиках как синоним proto:: when< proto:::_, Fun> как в следующем преобразовании, которое подсчитывает количество терминалов в выражении.

// 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> >
  >
{};


PrevUpHomeNext

Статья Struct template otherwise раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 23:43:25/0.0080509185791016/1