openMSX
Namespaces | Concepts | Functions
ranges.hh File Reference
#include <algorithm>
#include <bit>
#include <cassert>
#include <cstdint>
#include <functional>
#include <iterator>
#include <numeric>
#include <span>
#include <version>
Include dependency graph for ranges.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ranges
 

Concepts

concept  ranges::range
 
concept  ranges::sized_range
 

Functions

template<typename ForwardRange , typename Compare = std::less<>, typename Proj = std::identity>
bool ranges::is_sorted (ForwardRange &&range, Compare comp={}, Proj proj={})
 
template<typename RandomAccessRange >
constexpr void ranges::sort (RandomAccessRange &&range)
 
template<typename RandomAccessRange , typename Compare >
constexpr void ranges::sort (RandomAccessRange &&range, Compare comp)
 
template<typename RAIter , typename Compare = std::less<>, typename Proj >
constexpr void ranges::sort (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
constexpr void ranges::sort (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename RandomAccessRange >
void ranges::stable_sort (RandomAccessRange &&range)
 
template<typename RandomAccessRange , typename Compare >
void ranges::stable_sort (RandomAccessRange &&range, Compare comp)
 
template<typename RAIter , typename Compare = std::less<>, typename Proj >
void ranges::stable_sort (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
void ranges::stable_sort (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename ForwardRange , typename T >
bool ranges::binary_search (ForwardRange &&range, const T &value)
 
template<typename ForwardRange , typename T , typename Compare >
bool ranges::binary_search (ForwardRange &&range, const T &value, Compare comp)
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::lower_bound (ForwardRange &&range, const T &value, Compare comp={}, Proj proj={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::upper_bound (ForwardRange &&range, const T &value, Compare comp={}, Proj proj={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>>
auto ranges::equal_range (ForwardRange &&range, const T &value, Compare comp={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::equal_range (ForwardRange &&range, const T &value, Compare comp, Proj proj)
 
template<typename InputRange , typename T >
auto ranges::find (InputRange &&range, const T &value)
 
template<typename InputRange , typename T , typename Proj >
auto ranges::find (InputRange &&range, const T &value, Proj proj)
 
template<typename InputRange , typename UnaryPredicate >
auto ranges::find_if (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
constexpr bool ranges::all_of (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
constexpr bool ranges::any_of (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
constexpr bool ranges::none_of (InputRange &&range, UnaryPredicate pred)
 
template<typename ForwardRange >
auto ranges::unique (ForwardRange &&range)
 
template<typename ForwardRange , typename BinaryPredicate >
auto ranges::unique (ForwardRange &&range, BinaryPredicate pred)
 
template<typename RAIter , typename Compare = std::equal_to<>, typename Proj >
auto ranges::unique (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::equal_to<>, typename Proj >
auto ranges::unique (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename InputRange , typename OutputIter >
requires (!range<OutputIter>)
constexpr auto ranges::copy (InputRange &&range, OutputIter out)
 
template<sized_range Input, sized_range Output>
constexpr auto ranges::copy (Input &&in, Output &&out)
 
template<typename InputRange , typename OutputIter , typename UnaryPredicate >
auto ranges::copy_if (InputRange &&range, OutputIter out, UnaryPredicate pred)
 
template<typename InputRange , typename OutputIter , typename UnaryOperation >
auto ranges::transform (InputRange &&range, OutputIter out, UnaryOperation op)
 
template<typename ForwardRange , typename Generator >
void ranges::generate (ForwardRange &&range, Generator &&g)
 
template<typename ForwardRange , typename T >
auto ranges::remove (ForwardRange &&range, const T &value)
 
template<typename ForwardRange , typename UnaryPredicate >
auto ranges::remove_if (ForwardRange &&range, UnaryPredicate pred)
 
template<typename ForwardRange , typename T >
constexpr void ranges::replace (ForwardRange &&range, const T &old_value, const T &new_value)
 
template<typename ForwardRange , typename UnaryPredicate , typename T >
void ranges::replace_if (ForwardRange &&range, UnaryPredicate pred, const T &new_value)
 
template<typename ForwardRange , typename T >
constexpr void ranges::fill (ForwardRange &&range, const T &value)
 
template<typename ForwardIt , typename T >
constexpr void ranges::iota (ForwardIt first, ForwardIt last, T value)
 
template<typename ForwardRange , typename T >
constexpr void ranges::iota (ForwardRange &&range, T &&value)
 
template<typename InputRange , typename T >
ranges::accumulate (InputRange &&range, T init)
 
template<typename InputRange , typename T , typename BinaryOperation >
ranges::accumulate (InputRange &&range, T init, BinaryOperation op)
 
template<typename InputRange , typename T >
auto ranges::count (InputRange &&range, const T &value)
 
template<typename InputRange , typename UnaryPredicate >
auto ranges::count_if (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange1 , typename InputRange2 , typename OutputIter >
auto ranges::set_difference (InputRange1 &&range1, InputRange2 &&range2, OutputIter out)
 
template<range InputRange1, range InputRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
constexpr bool ranges::equal (InputRange1 &&range1, InputRange2 &&range2, Pred pred={}, Proj1 proj1={}, Proj2 proj2={})
 
template<sized_range SizedRange1, sized_range SizedRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
constexpr bool ranges::equal (SizedRange1 &&range1, SizedRange2 &&range2, Pred pred={}, Proj1 proj1={}, Proj2 proj2={})
 
template<typename InputRange , typename Proj = std::identity>
bool ranges::all_equal (InputRange &&range, Proj proj={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto * binary_find (ForwardRange &&range, const T &value, Compare comp={}, Proj proj={})
 
template<typename Range >
constexpr auto make_span (Range &&range)
 
template<typename Range >
constexpr auto subspan (Range &&range, size_t offset, size_t count=std::dynamic_extent)
 
template<size_t Count, typename Range >
constexpr auto subspan (Range &&range, size_t offset=0)
 
template<typename T , size_t Size>
auto as_byte_span (std::span< T, Size > s)
 

Function Documentation

◆ as_byte_span()

template<typename T , size_t Size>
auto as_byte_span ( std::span< T, Size >  s)
inline

Definition at line 493 of file ranges.hh.

Referenced by openmsx::AviWriter::addFrame().

◆ binary_find()

template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto * binary_find ( ForwardRange &&  range,
const T &  value,
Compare  comp = {},
Proj  proj = {} 
)

◆ make_span()

template<typename Range >
constexpr auto make_span ( Range &&  range)
constexpr

Definition at line 462 of file ranges.hh.

Referenced by openmsx::ImGuiVdpRegs::paint(), subspan(), and subspan().

◆ subspan() [1/2]

template<typename Range >
constexpr auto subspan ( Range &&  range,
size_t  offset,
size_t  count = std::dynamic_extent 
)
constexpr

◆ subspan() [2/2]

template<size_t Count, typename Range >
constexpr auto subspan ( Range &&  range,
size_t  offset = 0 
)
constexpr

Definition at line 487 of file ranges.hh.

References make_span().