Files
libconfig/build-config/reflect-cpp/include/rfl/internal/tup_to_ptr_tuple.hpp
Emily Boudreaux ec13264050 feat(reflect-cpp): Switched from glaze -> reflect cpp
A bug was discovered in glaze which prevented valid toml output. We have
switched to toml++ and reflect-cpp. The interface has remained the same
so this should not break any code
2025-12-06 10:55:46 -05:00

26 lines
585 B
C++

#ifndef RFL_INTERNAL_TUP_TO_PTR_TUPLE_HPP_
#define RFL_INTERNAL_TUP_TO_PTR_TUPLE_HPP_
#include "../Field.hpp"
#include "../Tuple.hpp"
#include "../apply.hpp"
#include "../make_named_tuple.hpp"
namespace rfl {
namespace internal {
/// Generates a named tuple that contains pointers to the original values in
/// the struct from a tuple.
template <class TupleType>
auto tup_to_ptr_tuple(TupleType& _t) {
const auto to_ptr = [](auto&... _fields) {
return rfl::make_tuple(&_fields...);
};
return rfl::apply(to_ptr, _t);
}
} // namespace internal
} // namespace rfl
#endif