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 _state

boost::proto::_state — A PrimitiveTransform that returns the current state unmodified.

Synopsis

// In header: <boost/proto/transform/arg.hpp>


struct _state :  proto::transform< _state > {
  // member classes/structs/unions
  template<typename Expr, typename State, typename Data> 
  struct impl :  proto::transform_impl< Expr, State, Data > {
    // types
    typedef State result_type;

    // public member functions
    State operator()(typename impl::expr_param, typename impl::state_param, 
                     typename impl::data_param) const;
  };
};

Description

Example:

proto::terminal<int>::type i = {42};
char ch = proto::_state()(i, 'a');
assert( ch == 'a' );


PrevUpHomeNext