Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template child

boost::proto::functional::child — A callable PolymorphicFunctionObject that is equivalent to the proto::child() function.

Synopsis

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

template<typename N> 
struct child :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename Expr> 
  struct result<> :  proto::result_of::child< Expr, N > {
  };

  // public member functions
  template<typename Expr> 
    proto::result_of::child<  
    () ;
  template<typename Expr> 
    proto::result_of::child<  
    () ;
};

Description

A callable PolymorphicFunctionObject that is equivalent to the proto::child() function. N is required to be an MPL Integral Constant.

child public member functions

  1. template<typename Expr> 
      proto::result_of::child<  
      ( expr) ;

    Return the Nth child of the given expression.

    Parameters:

    expr

    The expression node.

    Requires:

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

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

    Returns:

    proto::child<N>(expr)

    Throws:

    Will not throw.
  2. template<typename Expr> 
      proto::result_of::child<  
      ( expr) ;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


PrevUpHomeNext