Boost C++ 库

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

PrevUpHomeNext

函数 find_format_all_copy

boost::algorithm::find_format_all_copy — 通用的全部替换算法。

概要

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


template<typename OutputIteratorT, typename RangeT, typename FinderT, 
         typename FormatterT> 
  OutputIteratorT 
  find_format_all_copy(OutputIteratorT Output, const RangeT & Input, 
                       FinderT Finder, FormatterT Formatter);
template<typename SequenceT, typename FinderT, typename FormatterT> 
  SequenceT find_format_all_copy(const SequenceT & Input, FinderT Finder, 
                                 FormatterT Formatter);

描述

使用 Finder 查找子字符串。 使用 Formatter 格式化此子字符串并在输入中替换它。 对所有匹配的子字符串重复此操作。 结果是输入的一个修改副本。 它作为序列返回或复制到输出迭代器。

[Note] 注意

此函数的第二种变体提供了强大的异常安全保证

参数

输出

结果将被复制到的输出迭代器

输入

一个输入序列

Finder

用于搜索要替换的匹配项的 Finder 对象

Formatter

用于格式化匹配项的 Formatter 对象

返回值

指向最后一个插入字符之后的输出迭代器或输入的修改副本


PrevUpHomeNext