“...世界上最受尊敬和设计最精良的 C++ 库项目之一。” — Herb Sutter 和 Andrei Alexandrescu, C++ 编码标准
boost::algorithm::find_format_all — 通用替换所有算法。
// In header: <boost/algorithm/string/find_format.hpp> template<typename SequenceT, typename FinderT, typename FormatterT> void find_format_all(SequenceT & Input, FinderT Finder, FormatterT Formatter);
使用 Finder 搜索子字符串。使用 Formatter 格式化此子字符串并将其替换到输入中。对所有匹配的子字符串重复此操作。输入会被就地修改。
参数
输入
一个输入序列
Finder
一个 Finder 对象,用于搜索要替换的匹配项
Formatter
一个 Formatter 对象,用于格式化匹配项