boost::range::overwrite

References

Headers

boost::range::overwrite is available by including any of the following headers:

  • boost/range/algorithm_ext/overwrite.hpp or
  • boost/range/algorithm_ext.hpp

Examples

overwrite.cpp

#include <iostream>
#include <vector>
#include <boost/range/algorithm.hpp>
#include <boost/range/algorithm_ext.hpp>

int main() {
    std::vector<int> src = {3, 4, 5};
    std::vector<int> target = {95, 96, 97, 98, 99};

    // Copy values from one range to another, overwriting the target values.
    boost::range::overwrite(src, target);

    boost::copy(target, std::ostream_iterator<int>(std::cout, " "));
    std::cout << std::endl;
    return 0;
}

Output:

3 4 5 98 99

 

Boost Range for Humans

This reference is part of Boost Range for Humans. Click the link to the overview.