libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
Functions | |
constexpr auto | fields (auto &&aggregate) noexcept |
Get a tuple of references to each of the fields of an aggregate. More... | |
template<std::size_t N> | |
constexpr void | forEachIndex (auto fn) |
Execute a function once for each index in the sequence from 0 up to, but not including, a given count N. More... | |
constexpr void | forEach (auto &&tuple, auto fn) |
Execute a function once for each element in a given tuple, sequentially. More... | |
constexpr auto | transform (auto &&tuple, auto fn) |
Execute a function for each element in a given tuple and return a tuple containing the results. More... | |
Variables | |
template<typename T > | |
constexpr std::size_t | aggregate_size_v = aggregate_size<T>::value |
The number of fields in a given aggregate type. More... | |
|
constexprnoexcept |
Get a tuple of references to each of the fields of an aggregate.
aggregate | a forwarding reference to an object of aggregate type. |
|
constexpr |
Execute a function once for each index in the sequence from 0 up to, but not including, a given count N.
The callback function is passed an instance of std::integral_constant<std::size_t, I> where I is the corresponding index.
N | the number of indices in the sequence. |
fn | the function to execute. Must accept an object of type std::integral_constant<std::size_t, I> as a parameter, where I is any integer from 0 up to, but not including, N. |
any | exception thrown by fn. |
|
constexpr |
Execute a function once for each element in a given tuple, sequentially.
The callback function is passed a reference to the element at each respective index of the tuple.
tuple | the tuple to iterate. |
fn | the function to execute. Must accept a reference to each of the types in the tuple as a parameter. |
any | exception thrown by fn. |
|
constexpr |
Execute a function for each element in a given tuple and return a tuple containing the results.
The callback function is passed a reference to the element at each respective index of the tuple.
tuple | the tuple to transform. |
fn | the function to execute. Must accept a reference to each of the types in the tuple as a parameter and return a non-void value. |
any | exception thrown by fn or by making a tuple from the results. |
|
inlineconstexpr |
The number of fields in a given aggregate type.
T | aggregate type to get the number of fields in. |