libdonut  2.3.2
Application framework for cross-platform game development in C++20
Namespaces | Functions | Variables
reflection.hpp File Reference
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Namespaces

 donut
 
 donut::reflection
 

Functions

constexpr auto donut::reflection::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 donut::reflection::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 donut::reflection::forEach (auto &&tuple, auto fn)
 Execute a function once for each element in a given tuple, sequentially. More...
 
constexpr auto donut::reflection::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 donut::reflection::aggregate_size_v = aggregate_size<T>::value
 The number of fields in a given aggregate type. More...