Boost C++ 库

...这是世界上最受推崇、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

Struct template unpack_expr - Boost C++ 函数库
PrevUpHomeNext

Struct template 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