Range and iterator tools, mostly backported from the standard library.
More...
|
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 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 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.
◆ to_vector()
template<class T >
auto to_vector |
( |
span< T > |
s | ) |
|
Copy a span into a std::vector.
◆ transform()
template<class S , class D , class F >
constexpr void transform |
( |
S && |
s, |
|
|
D |
d, |
|
|
F && |
f |
|
) |
| |
|
constexpr |
A simple subset of std::ranges::transform
from C++20.
This function supports GPU execution.
- Parameters
-
s | source range |
d | destination iterator |
◆ partition_point()
template<class R , class F >
constexpr auto partition_point |
( |
R && |
r, |
|
|
F && |
f |
|
) |
| |
|
constexpr |
A subset of std::ranges::partition_point
from C++20.
This function supports GPU execution.
- Parameters
-
- Returns
- an iterator to the first element for which f returns
false
◆ binary_index()
template<class R , class T = std::remove_reference_t<decltype(*std::begin(std::declval<R>()))>>
constexpr auto binary_index |
( |
R && |
r, |
|
|
const T & |
t |
|
) |
| |
|
constexpr |
Find the index of a value in a sorted range.
This function supports GPU execution.
- Parameters
-
◆ permutation_view()
template<class B , class R >
constexpr 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 supports GPU execution.
- Parameters
-
b | random-access starting iterator |
r | range of offsets from b |
- Returns
- view of selected elements, random access iff
R
is