Boost C++ 库

...世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

结构模板 as_child - Boost C++ 函数库
PrevUpHomeNext

结构模板 as_child

boost::proto::functional::as_child — 一个可调用的 多态函数对象,等效于 proto::as_child() 函数。

提要

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

template<typename Domain = proto::default_domain> 
struct as_child :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename T> 
  struct result<This(T)> :  proto::result_of::as_child< typename remove_reference< T >::type, Domain >
  {
  };

  // public member functions
  template<typename T> 
    typename proto::result_of::as_child< T, Domain >::type 
    operator()(T &) const;
  template<typename T> 
    typename proto::result_of::as_child< T const, Domain >::type 
    operator()(T const &) const;
};

描述

as_child 公有成员函数

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

    如果对象本身不是 Proto 表达式,则将其包装在 Proto 终结符中。

    参数

    t

    需要包装的对象。

    返回

    proto::as_child<Domain>(t)

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

    这是一个重载的成员函数,为方便起见提供。它仅在接受的参数不同时与上述函数有所区别。


PrevUpHomeNext