TRIQS/itertools 1.3.0
C++ range library
Loading...
Searching...
No Matches
sort.hpp
#include <algorithm>
#include <cstddef>
#include <functional>
#include <iterator>
#include <ranges>

Detailed Description

Provides functions for sorting ranges.

Definition in file sort.hpp.

Go to the source code of this file.

Functions

template<std::forward_iterator ForwardIt, class Compare = std::less<>>
std::size_t itertools::bubble_sort (ForwardIt first, ForwardIt last, Compare comp={})
 Bubble sort elements in the given range.
template<std::ranges::forward_range Range, class Compare = std::less<>>
std::size_t itertools::bubble_sort (Range &&rng, Compare comp={})
 Bubble sort elements in the given range.
template<std::bidirectional_iterator BidirIt, class Compare = std::less<>>
std::size_t itertools::insertion_sort (BidirIt first, BidirIt last, Compare comp={})
 Insertion sort elements in the given range.
template<std::ranges::bidirectional_range Range, class Compare = std::less<>>
std::size_t itertools::insertion_sort (Range &&rng, Compare comp={})
 Insertion sort elements in the given range.