boost::proto::functional::child — 一个可调用的 多态函数对象 (PolymorphicFunctionObject),等价于 proto::child()
函数。
// In header: <boost/proto/traits.hpp> template<typename N = mpl::long_<0> > struct child : proto::callable { // member classes/structs/unions template<typename This, typename Expr> struct result<This(Expr)> : proto::result_of::child< Expr, N > { }; // public member functions template<typename Expr> typename proto::result_of::child< Expr &, N >::type operator()(Expr &) const; template<typename Expr> typename proto::result_of::child< Expr const &, N >::type operator()(Expr const &) const; };
一个可调用的 多态函数对象 (PolymorphicFunctionObject),等价于 proto::child()
函数。 N
必须是 MPL 整数常量。
child
公有成员函数template<typename Expr> typename proto::result_of::child< Expr &, N >::type operator()(Expr & expr) const;
返回给定表达式的第 N
th 个子节点。
参数 |
|
||
要求 |
|
||
返回值 |
|
||
抛出 |
不会抛出异常。 |
template<typename Expr> typename proto::result_of::child< Expr const &, N >::type operator()(Expr const & expr) const;
这是一个重载的成员函数,为了方便起见而提供。它与上面的函数唯一的不同之处在于它接受的参数。