draconisplusplus/include/rfl/internal/processed_t.hpp

29 lines
802 B
C++
Raw Normal View History

2024-05-31 22:59:00 -04:00
#ifndef RFL_INTERNAL_PROCESSED_T_HPP_
#define RFL_INTERNAL_PROCESSED_T_HPP_
#include <type_traits>
#include "../Processors.hpp"
#include "../named_tuple_t.hpp"
namespace rfl::internal {
2024-06-08 14:10:59 -04:00
template <class StructType, class ProcessorsType>
struct Processed;
template <class StructType, class... Ps>
struct Processed<StructType, Processors<Ps...>> {
using NamedTupleType = named_tuple_t<StructType>;
using type = typename std::invoke_result<
2024-06-08 15:53:06 -04:00
decltype(Processors<
Ps...>::template process<StructType, NamedTupleType>),
2024-06-08 14:10:59 -04:00
NamedTupleType>::type;
};
template <class StructType, class ProcessorsType>
using processed_t = typename Processed<StructType, ProcessorsType>::type;
} // namespace rfl::internal
2024-05-31 22:59:00 -04:00
#endif