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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function as_child

boost::proto::as_child — A function that wraps non-Proto objects in Proto terminals (by reference) and leaves Proto expression types alone.

Synopsis

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


template<typename T> 
  typename proto::result_of::as_child< T >::type as_child(T & t);
template<typename T> 
  typename proto::result_of::as_child< T const >::type as_child(T const & t);
template<typename Domain, typename T> 
  typename proto::result_of::as_child< T, Domain >::type as_child(T & t);
template<typename Domain, typename T> 
  typename proto::result_of::as_child< T const, Domain >::type 
  as_child(T const & t);

Description

The proto::as_child() function returns Proto expression objects that are suitable for storage as child nodes in an expression tree. It turns non-Proto objects into Proto terminals. Its behavior is domain-specific. By default, non-Proto types are held wrapped by reference in a new Proto terminal expression, and objects that are already Proto expressions are simply returned by reference.

If Domain is not explicitly specified, it is assumed to be proto::default_domain.

See proto::domain::as_child<> for a complete description of this function's default behavior.

Returns:

typename Domain::template as_child< T >()(t)

PrevUpHomeNext