draconisplusplus/include/rfl/internal/copy_from_named_tuple.hpp

21 lines
519 B
C++
Raw Normal View History

2024-05-31 22:59:00 -04:00
#ifndef RFL_INTERNAL_COPY_FROM_NAMED_TUPLE_HPP_
#define RFL_INTERNAL_COPY_FROM_NAMED_TUPLE_HPP_
#include "move_from_named_tuple.hpp"
namespace rfl {
2024-06-08 14:10:59 -04:00
namespace internal {
2024-05-31 22:59:00 -04:00
2024-06-08 14:10:59 -04:00
/// Creates a struct of type T from a named tuple.
/// All fields of the struct must be an rfl::Field.
template <class T, class NamedTupleType>
T copy_from_named_tuple(const NamedTupleType& _n) {
auto n = _n;
return move_from_named_tuple<T>(std::move(n));
}
2024-05-31 22:59:00 -04:00
2024-06-08 14:10:59 -04:00
} // namespace internal
} // namespace rfl
2024-05-31 22:59:00 -04:00
#endif