Boost C++ 库

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

函数模板 token_finder - Boost C++ 函数库
PrevUpHomeNext

函数模板 token_finder

boost::algorithm::token_finder — “Token” 查找器

提要

// In header: <boost/algorithm/string/finder.hpp>


template<typename PredicateT> 
  unspecified token_finder(PredicateT Pred, 
                           token_compress_mode_type eCompress = token_compress_off);

描述

构造 token_finder。该查找器搜索由谓词指定的 token。它类似于 std::find_if 算法,但不同之处在于它返回一个范围,而不是单个迭代器。

如果启用了“压缩 token 模式”,则相邻的匹配 token 将被连接成一个匹配项。因此,该查找器可用于搜索满足给定谓词的连续字符段。

结果以 iterator_range 的形式给出,用于限定匹配项。

参数

Pred

元素选择谓词

eCompress

压缩标志

返回

一个 token_finder 对象实例


PrevUpHomeNext