Boost C++ 库

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

函数 child - Boost C++ 函数库
PrevUpHomeNext

函数 child

boost::proto::child — 返回指定 Proto 表达式的第 N 个子表达式。

提要

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


template<typename N, typename Expr> 
  typename proto::result_of::child< Expr &, N >::type child(Expr & expr);
template<typename N, typename Expr> 
  typename proto::result_of::child< Expr const &, N >::type 
  child(Expr const & expr);
template<typename Expr> 
  typename proto::result_of::child< Expr & >::type child(Expr & expr);
template<typename Expr> 
  typename proto::result_of::child< Expr const & >::type 
  child(Expr const & expr);

描述

返回指定 Proto 表达式的第 N 个子表达式。如果未指定 N,例如在 proto::child(expr) 中,则假定 Nmpl::long_<0>。子表达式通过引用返回。

参数

expr

Proto 表达式。

要求

proto::is_expr<Expr>::valuetrue

N 是一个 MPL 积分常量。

N::value < Expr::proto_arity::value

返回

expr 的第 N 个子表达式的引用。

抛出

不会抛出异常。

PrevUpHomeNext