Boost C++ 库

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

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

Struct template as

boost::xpressive::op::as — as<> 是一个 PolymorphicFunctionObject,用于将参数进行词法转换到不同类型。

提要

// In header: <boost/xpressive/regex_actions.hpp>

template<typename T> 
struct as {
  // types
  typedef T result_type;

  // public member functions
  template<typename Value> T operator()(Value const &) const;
};

描述

模板参数

  1. typename T

    要进行词法转换的参数的目标类型。

as 公共成员函数

  1. template<typename Value> T operator()(Value const & val) const;

    参数

    val

    要进行词法转换的值。

    返回

    boost::lexical_cast<T>(val)


PrevUpHomeNext