...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::proto::as_child — A function that wraps non-Proto objects in Proto terminals (by reference) and leaves Proto expression types alone.
// 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);
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
for a complete description of this function's default behavior.
proto::domain::as_child
<>
Returns: |
typename Domain::template as_child< T >()(t) |