boost::proto::_default — 一个 PrimitiveTransform,赋予表达式其通常的 C++ 行为
// In header: <boost/proto/transform/default.hpp>
template<typename Grammar = unspecified
>
struct _default : proto::transform< _default<Grammar> > {
// member classes/structs/unions
template<typename Expr, typename State, typename Data>
struct impl : proto::transform_impl<Expr, State, Data> {
// types
typedef typename Expr::tag_type Tag; // For exposition only
typedef see-below result_type;
// public member functions
result_type operator()(typename impl::expr_param,
typename impl::state_param,
typename impl::data_param) const;
// public data members
static Expr s_expr; // For exposition only
static State s_state; // For exposition only
static Data s_data; // For exposition only
};
};
有关 proto::_default
转换的完整行为描述,请参见嵌套的 proto::_default::impl<>
类模板的文档。
当不指定 Grammar
参数时,proto::_default
的行为就像参数是 proto::_default<>
一样。