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

Struct template switch_

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 switch_

boost::proto::switch_ — For matching one of a set of alternate grammars, which are looked up based on the result type of the transform passed in second template parameter. If no transform is passed, the default one is proto::tag_of<proto::_>() so the default matching is based on the expression's tag type. When used as a transform, proto::switch_<> applies the transform associated with the sub-grammar that matches the expression.

Synopsis

// In header: <boost/proto/matches.hpp>
template<typename Cases, typename Transform> 
struct switch_ :  proto::transform<switch_<Cases, Transform> > {
  // types
  typedef switch_ proto_grammar;
  // member classes/structs/unions
  template<typename Expr, typename State, typename Data> 
  struct impl :  
    Cases::template case_<
      typename when<_, Transform>::template impl<Expr, State, Data>::result_type 
    >::template impl<Expr, State, Data>
  {
  };
};

Description

Тип выражения<E>матчи<proto::switch_<C,T>>, если<E>матчи<C::case_<boost::result_of<proto::when<proto::_,T>(E)>::type>>.

При применении<proto::switch_<C,T>>в качестве преобразования с выражением<e>типа<E>, состояния<s>типа<S>и данных<d>типа<D>он эквивалентен<C::case_<boost::result_of<proto::when<proto::_,T>(E,S,D)>::type>()(e, s, d)>.


PrevUpHomeNext

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 07:44:46/0.007108211517334/1