boost::proto::as_child — 一个函数,它将非 Proto 对象包装在 Proto 终端中(通过引用),并且保持 Proto 表达式类型不变。
// 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);
proto::as_child()
函数返回适合存储为表达式树中子节点的 Proto 表达式对象。 它将非 Proto 对象转换为 Proto 终端。 它的行为是特定于域的。 默认情况下,非 Proto 类型通过引用包装在一个新的 Proto 终端表达式中,而已经是 Proto 表达式的对象则简单地通过引用返回。
如果未明确指定 Domain
,则假定为
。proto::default_domain
有关此函数默认行为的完整描述,请参阅
。proto::domain::as_child
<>
返回 |
typename Domain::template as_child< T >()(t) |