replace_copy.qbk 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. [/
  2. Copyright 2010 Neil Groves
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. /]
  6. [section:replace_copy replace_copy]
  7. [heading Prototype]
  8. ``
  9. template<class ForwardRange, class OutputIterator, class Value>
  10. OutputIterator replace_copy(const ForwardRange& rng, OutputIterator out,
  11. const Value& what, const Value& with_what);
  12. ``
  13. [heading Description]
  14. `replace_copy` copy every element `x` in `rng` such that the corresponding element in the output range `y` is `x == what ? with_what : x`.
  15. [heading Definition]
  16. Defined in the header file `boost/range/algorithm/replace_copy.hpp`
  17. [heading Requirements]
  18. * `ForwardRange` is a model of the __forward_range__ Concept.
  19. * `ForwardRange` is mutable.
  20. * `Value` is convertible to `ForwardRange`'s value type.
  21. * `Value` is a model of the `AssignableConcept`.
  22. * `OutputIterator` is a model of the `OutputIteratorConcept`.
  23. [heading Complexity]
  24. Linear. `replace_copy` performs exactly `distance(rng)`.
  25. [endsect]