|
Go to the documentation of this file.
9 #ifndef ADOBE_ALGORITHM_REPLACE_HPP
10 #define ADOBE_ALGORITHM_REPLACE_HPP
14 #include <boost/range/begin.hpp>
15 #include <boost/range/end.hpp>
16 #include <boost/bind.hpp>
41 template < class ForwardRange, class T>
42 inline void replace(ForwardRange& range, const T& old_value, const T& new_value)
44 std::replace(boost::begin(range), boost::end(range), old_value, new_value);
52 template < class ForwardIterator, class Predicate, class T>
54 replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value)
64 template < class ForwardRange, class Predicate, class T>
65 inline void replace_if(ForwardRange& range, Predicate pred, const T& new_value)
75 template < class ForwardRange, class OutputIterator, class T>
77 replace_copy(ForwardRange& range, OutputIterator result, const T& old_value, const T& new_value)
79 return std::replace_copy(boost::begin(range), boost::end(range), result, old_value, new_value);
87 template < class ForwardRange, class OutputIterator, class T>
90 const T& old_value, const T& new_value)
92 return std::replace_copy(boost::begin(range), boost::end(range), result, old_value, new_value);
100 template < class ForwardIterator, class OutputIterator, class Predicate, class T>
101 inline OutputIterator
103 OutputIterator result, Predicate pred, const T& new_value)
113 template < class ForwardRange, class OutputIterator, class Predicate, class T>
114 inline OutputIterator
115 replace_copy_if(ForwardRange& range, OutputIterator result, Predicate pred, const T& new_value)
125 template < class ForwardRange, class OutputIterator, class Predicate, class T>
126 inline OutputIterator
128 Predicate pred, const T& new_value)
|