11#pragma once
22#include < meta>
33#include < ranges>
4+ #include < rsl/meta_traits>
45#include " util.hpp"
6+ #include " annotations.hpp"
57
68namespace rsl ::serializer {
79
@@ -64,13 +66,16 @@ struct Meta<T> {
6466 void descend (F&& visitor, U&& value) {
6567 template for (constexpr auto Idx : std::views::iota (0ZU, members.size ())) {
6668 constexpr auto M = members[Idx];
67- Member<Idx, M, typename [:type_of (M):]>{}.visit (visitor, value.[:M:]);
69+ if constexpr (!meta::has_annotation (M, ^^annotations::Skip)){
70+ Member<Idx, M, typename [:type_of (M):]>{}.visit (visitor, value.[:M:]);
71+ }
6872 }
6973 }
7074};
7175
7276template <std::ranges::range T>
73- requires std::constructible_from<std::initializer_list<typename T::value_type>>
77+ requires (std::constructible_from<std::initializer_list<typename T::value_type>> &&
78+ !std::convertible_to<T, std::string_view>)
7479struct Meta <T> {
7580 using type = T;
7681 using element_type = typename T::value_type;
@@ -111,4 +116,16 @@ struct Meta<std::optional<T>> {
111116 }
112117};
113118
119+ template <std::convertible_to<std::string> T>
120+ struct Meta <T> {
121+ using type = T;
122+ constexpr static std::meta::info info = ^^T;
123+
124+ template <typename S, typename F, typename U>
125+ requires (std::same_as<std::remove_cvref_t <U>, type>)
126+ void visit (this S&& self, F&& visitor, U&& value) {
127+ std::invoke (std::forward<F>(visitor), std::forward<S>(self), std::forward<U>(value));
128+ }
129+ };
130+
114131} // namespace rsl::serializer
0 commit comments