of elements   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_swap_ranges&action=edit)  
[ ranges::swap_ranges  ](/w/cpp/algorithm/ranges/swap_ranges "cpp/algorithm/ranges/swap ranges") (C++20)  |  swaps two ranges of elements   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/ranges/dsc_swap_ranges&action=edit)  
[ iter_swap  ](/w/cpp/algorithm/iter_swap "cpp/algorithm/iter swap") |  swaps the elements pointed to by two iterators   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_iter_swap&action=edit)  
  
####  [ [ edit ](/mwiki/index.php?title=cpp/algorithm&action=edit&section=10
"Edit section: Transformation operations") ]  Transformation operations

Defined in header ` [ <algorithm> ](/w/cpp/header/algorithm
"cpp/header/algorithm") `  
---  
[ transform  ](/w/cpp/algorithm/transform "cpp/algorithm/transform") |  applies a function to a range of elements, storing results in a destination range   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_transform&action=edit)  
[ ranges::transform  ](/w/cpp/algorithm/ranges/transform "cpp/algorithm/ranges/transform") (C++20)  |  applies a function to a range of elements   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/ranges/dsc_transform&action=edit)  
[ replace  replace_if  ](/w/cpp/algorithm/replace "cpp/algorithm/replace") |  replaces all values satisfying specific criteria with another value   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_replace&action=edit)  
[ ranges::replace  ranges::replace_if  ](/w/cpp/algorithm/ranges/replace "cpp/algorithm/ranges/replace") (C++20)  (C++20)  |  replaces all values satisfying specific criteria with another value   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/ranges/dsc_replace&action=edit)  
[ replace_copy  replace_copy_if  ](/w/cpp/algorithm/replace_copy "cpp/algorithm/replace copy") |  copies a range, replacing elements satisfying specific criteria with another value   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_replace_copy&action=edit)  
[ ranges::replace_copy  ranges::replace_copy_if  ](/w/cpp/algorithm/ranges/replace_copy "cpp/algorithm/ranges/replace copy") (C++20)  (C++20)  |  copies a range, replacing elements satisfying specific criteria with another value   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/ranges/dsc_replace_copy&action=edit)  
  
####  [ [ edit ](/mwiki/index.php?title=cpp/algorithm&action=edit&section=11
"Edit section: Generation operations") ]  Generation operations

Defined in header ` [ <algorithm> ](/w/cpp/header/algorithm
"cpp/header/algorithm") `  
---  
[ fill  ](/w/cpp/algorithm/fill "cpp/algorithm/fill") |  copy-assigns the given value to every element in a range   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_fill&action=edit)  
[ ranges::fill  ](/w/cpp/algorithm/ranges/fill "cpp/algorithm/ranges/fill") (C++20)  |  assigns a range of elements a certain value   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/ranges/dsc_fill&action=edit)  
[ fill_n  ](/w/cpp/algorithm/fill_n "cpp/algorithm/fill n") |  copy-assigns the given value to N elements in a range   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_fill_n&action=edit)  
[ ranges::fill_n  ](/w/cpp/algorithm/ranges/fill_n "cpp/algorithm/ranges/fill n") (C++20)  |  assigns a value to a number of elements   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?ti