Boost C++ Libraries

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

Click here to view the latest version of this page.
PrevUpHomeNext

Struct template child_c

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

Synopsis

template<long N> 
struct child_c :  proto::callable {
  template<typename This, typename Expr> 
  struct result<This(Expr)> :  proto::result_of::child_c< Expr, N > {
  };

  // public member functions
  template<typename Expr> 
    typename proto::result_of::child_c< Expr &, N >::type 
    operator()(Expr &) const;
  template<typename Expr> 
    typename proto::result_of::child_c< Expr const &, N >::type 
    operator()(Expr const &) const;
};

Description

child_c public member functions

  1. template<typename Expr> 
      typename proto::result_of::child_c< Expr &, N >::type 
      operator()(Expr & expr) const;

    Return the Nth child of the given expression.

    Parameters:

    expr

    The expression node.

    Requires:

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

    N < Expr::proto_arity::value

    Returns:

    proto::child_c<N>(expr)

    Throws:

    Will not throw.
  2. template<typename Expr> 
      typename proto::result_of::child_c< Expr const &, N >::type 
      operator()(Expr const & expr) const;

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


PrevUpHomeNext