Boost C++ 库

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

PrevUpHomeNext

结构体模板 vararg

boost::proto::vararg — 用于将语法匹配到可变数量的子表达式。

概要

// In header: <boost/proto/matches.hpp>

template<typename Grammar> 
struct vararg {
};

描述

表达式类型 proto::basic_expr<AT, proto::listN<A0,...An,U0,...Um> > 匹配语法 proto::basic_expr<BT, proto::listM<B0,...Bn,proto::vararg<V> > >,如果 BTproto::_AT, 并且如果对于 [0,n] 中的每个 xAx 匹配 Bx, 并且如果对于 [0,m] 中的每个 xUx 匹配 V

例如

// Match any function call expression, regardless
// of the number of function arguments:
struct Function :
  proto::function< proto::vararg<proto::_> >
{};

当用作转换时,proto::vararg<G> 应用 G 的转换。


PrevUpHomeNext