| Home | Libraries | People | FAQ | More

## Struct template _child_c

boost::proto::_child_c — A PrimitiveTransform that returns N-th child of the current expression.

## Synopsis

    // In header: <boost/proto/transform/arg.hpp>

    template<int N>
    struct _child_c :  proto::transform< _child_c<N> > {
      template<typename Expr, typename State, typename Data>
      struct impl :  proto::transform_impl< Expr, State, Data > {
        // types
        typedef typename proto::result_of::child_c< Expr, N >::type result_type;

        // public member functions
        typename proto::result_of::child_c< Expr, N >::type
        operator()(typename impl::expr_param, typename impl::state_param,
                   typename impl::data_param) const;
      };
    };

## Description

Example:

    proto::terminal<int>::type i = {42};
    proto::terminal<int>::type & j = proto::_child_c<0>()(-i);
    assert( boost::addressof(i) == boost::addressof(j) );