Boost C++ 库

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

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

结构体模板 unpack_expr

boost::proto::functional::unpack_expr — 一个等同于 proto::unpack_expr() 函数的 PolymorphicFunctionObject

提要

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

template<typename Tag, typename Domain = proto::deduce_domain> 
struct unpack_expr :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename Sequence> 
  struct result<This(Sequence)> :  
    proto::result_of::unpack_expr<
      Tag,
      Domain,
      typename boost::remove_reference< Sequence >::type
    >
  {
  };

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

描述

在所有情况下,proto::functional::unpack_expr<Tag, Domain>()(seq) 等同于 proto::unpack_expr()<Tag, Domain>(seq)

proto::functional::unpack_expr<Tag>()(seq) 等同于 proto::unpack_expr()<Tag>(seq)

unpack_expr 公有成员函数

  1. template<typename Sequence> 
      typename proto::result_of::unpack_expr< Tag, Domain, Sequence const >::type const 
      operator()(Sequence const & sequence) const;

    构造一个标签类型为 Tag 并且在 Domain 域中的表达式节点。

    参数

    序列

    一个 Fusion Forward Sequence

    返回

    proto::unpack_expr<Tag, Domain>(sequence)


PrevUpHomeNext