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
This commit is contained in:
35
build-config/reflect-cpp/include/rfl/as.hpp
Normal file
35
build-config/reflect-cpp/include/rfl/as.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef RFL_AS_HPP_
|
||||
#define RFL_AS_HPP_
|
||||
|
||||
#include "from_named_tuple.hpp"
|
||||
#include "make_named_tuple.hpp"
|
||||
#include "to_named_tuple.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
/// Generates a type T from the input values.
|
||||
template <class T, class Head, class... Tail>
|
||||
T as(Head&& _head, Tail&&... _tail) {
|
||||
if constexpr (sizeof...(_tail) == 0) {
|
||||
return from_named_tuple<T>(to_named_tuple(std::forward<Head>(_head)));
|
||||
} else {
|
||||
return from_named_tuple<T>(
|
||||
to_named_tuple(std::forward<Head>(_head))
|
||||
.add(to_named_tuple(std::forward<Tail>(_tail))...));
|
||||
}
|
||||
}
|
||||
|
||||
/// Generates a type T from the input values.
|
||||
template <class T, class Head, class... Tail>
|
||||
T as(const Head& _head, const Tail&... _tail) {
|
||||
if constexpr (sizeof...(_tail) == 0) {
|
||||
return from_named_tuple<T>(to_named_tuple(_head));
|
||||
} else {
|
||||
return from_named_tuple<T>(
|
||||
to_named_tuple(_head).add(to_named_tuple(_tail)...));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace rfl
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user