.. Generated automatically by cpp2rst .. highlight:: c .. role:: red .. role:: green .. role:: param .. _itertools__insertion_sort: itertools::insertion_sort ========================= *#include * **Synopsis** .. rst-class:: cppsynopsis 1. | :green:`template` | std::size_t :red:`insertion_sort` (BidirIt :param:`first`, BidirIt :param:`last`, Compare :param:`comp` = {}) 2. | :green:`template` | std::size_t :red:`insertion_sort` (Range && :param:`rng`, Compare :param:`comp` = {}) Documentation Template parameters ^^^^^^^^^^^^^^^^^^^ * :param:`BidirIt` Bidirectional iterator type. * :param:`Compare` Comparison function type. * :param:`Range` Bidirectional range type. Parameters ^^^^^^^^^^ * :param:`first` Bidirectional iterator to the first element of the range. * :param:`last` Bidirectional iterator to the element after the last of the range. * :param:`comp` Comparison function callable with two dereferenced iterators. * :param:`rng` A bidirectional range to sort. Returns ^^^^^^^ Number of swaps necessary to sort the range.