Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::swap_ranges is an algorithm to swap two container ranges.
std::swap_ranges is defined in the header file algorithm.h.
In the example below, two ranges in one same container are swapped. The two ranges, however, may also be of two different containers. It is undefined what happens if the ranges overlap.
#include <algorithm> |
Screen output:
-AA-BB- |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.