|
| template<class R, class T = std::remove_reference_t<decltype(*std::begin(std::declval<R>()))>> |
| constexpr auto | binary_index (R &&r, const T &t) |
| | Find the index of a value in a sorted range.
|
| template<class R, class A, class B> |
| bool | ckd_mul (R *result, A a, B b) |
| | A simple implementation of ckd_mul from C++26.
|
| template<class R, class F> |
| constexpr auto | partition_point (R &&r, F &&f) |
| | A subset of std::ranges::partition_point from C++20.
|
| template<class B, class R> |
| constexpr auto | permutation_view (B b, R r) |
| | A view of a (partial) permutation of a range.
|
| template<class R> |
| constexpr auto | stride_view (R &&r, typename std::iterator_traits< decltype(std::begin(std::declval< R >()))>::difference_type n, decltype(n) o=0) |
| | A simple emulation of std::stride_view from C++23 for random-access underlying ranges.
|
| template<class T> |
| auto | to_vector (span< T > s) |
| | Copy a span into a std::vector.
|
| template<class S, class D, class F> |
| constexpr void | transform (S &&s, D d, F &&f) |
| | A simple subset of std::ranges::transform from C++20.
|
Range and iterator tools, mostly backported from the standard library.
template<class B, class R>
| auto permutation_view |
( |
B | b, |
|
|
R | r ) |
|
constexpr |
A view of a (partial) permutation of a range.
Elements need not be sorted (though see also binary_index) and may be repeated (with caution for the resulting aliasing).
This function is supported for GPU execution.
- Parameters
-
| b | random-access starting iterator |
| r | range of offsets from b |
- Returns
- view of selected elements, random access iff
R is