Boost C++ 库

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

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

结构模板作为

boost::xpressive::op::as — as<> 是一个多态函数对象,用于将参数词法转换为不同的类型。

提要

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

template<typename T> 
struct as {

  // 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