diff --git a/include/rfl/NamedTuple.hpp b/include/rfl/NamedTuple.hpp index ba9619be..4498d838 100644 --- a/include/rfl/NamedTuple.hpp +++ b/include/rfl/NamedTuple.hpp @@ -8,6 +8,7 @@ #include #include "Field.hpp" +#include "Literal.hpp" #include "get.hpp" #include "internal/StringLiteral.hpp" #include "internal/find_index.hpp" @@ -29,8 +30,8 @@ template class NamedTuple { public: using Fields = std::tuple...>; - using Values = - std::tuple::type::Type...>; + using Names = Literal::name_...>; + using Values = std::tuple::Type...>; public: /// Construct from the values. @@ -555,6 +556,7 @@ template <> class NamedTuple<> { public: using Fields = std::tuple<>; + using Names = Literal<>; using Values = std::tuple<>; NamedTuple(){}; diff --git a/include/rfl/internal/make_tag.hpp b/include/rfl/internal/make_tag.hpp index 4004a3dd..38a44f0a 100644 --- a/include/rfl/internal/make_tag.hpp +++ b/include/rfl/internal/make_tag.hpp @@ -3,6 +3,7 @@ #include "../Literal.hpp" #include "../field_names_t.hpp" +#include "../named_tuple_t.hpp" #include "../to_view.hpp" #include "StringLiteral.hpp" #include "get_type_name.hpp" @@ -16,7 +17,8 @@ template static inline auto make_tag(const T& _t) noexcept { if constexpr (internal::has_reflection_type_v) { return make_tag(); - } else if constexpr (field_names_t::template contains<_discriminator>()) { + } else if constexpr (named_tuple_t::Names::template contains< + _discriminator>()) { return *to_view(_t).template get<_discriminator>(); } else if constexpr (internal::has_tag_v) { using LiteralType = typename T::Tag;