Boost C++ 库

...世界上最受尊敬和设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码标准

PrevUpHomeNext

结构体 _value

boost::proto::_value — 一个 原始转换 (PrimitiveTransform),它返回当前终端表达式的值。

概要

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

描述

示例

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


PrevUpHomeNext