Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function child

boost::proto::child — Return the Nth child of the specified Proto expression.

Synopsis

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

Description

Return the Nth child of the specified Proto expression. If N is not specified, as in proto::child(expr), then N is assumed to be mpl::long_<0>. The child is returned by reference.

Parameters:

expr

The Proto expression.

Requires:

proto::is_expr<Expr>::value is true.

N is an MPL Integral Constant.

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

Returns:

A reference to the Nth child of expr.

Throws:

Will not throw.

PrevUpHomeNext