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
26 lines
585 B
C++
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
|