Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.

Function find_format_all_copy

boost::algorithm::find_format_all_copy — Generic replace all algorithm.


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


Use the Finder to search for a substring. Use the Formatter to format this substring and replace it in the input. Repeat this for all matching substrings. The result is a modified copy of the input. It is returned as a sequence or copied to the output iterator.



A Finder object used to search for a match to be replaced


A Formatter object used to format a match


An input sequence


An output iterator to which the result will be copied

Returns: An output iterator pointing just after the last inserted character or a modified copy of the input
Notes: The second variant of this function provides the strong exception-safety guarantee

Copyright 2002-2004 Pavol Droba