Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct _value

boost::proto::_value — A PrimitiveTransform that returns the value of the current terminal expression.

Synopsis

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


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

    // public member functions
    typename proto::result_of::value< Expr >::type 
    operator()(typename impl::expr_param, typename impl::state_param, 
               typename impl::data_param) const;
  };
};

Description

Example:

proto::terminal<int>::type i = {42};
int j = proto::_value()(i);
assert( 42 == j );


PrevUpHomeNext