v0.1.4
Changed
- Change: serde() function for reflection
- Before
template<class Context> constexpr static void serde(Context& context, Type& value) { using namespace serde::attribute; using Self [[maybe_unused]] = Type; serde::serde_struct ss(context, value); }
- After
template<class Context> constexpr static auto serde(Context& context, Type& value) { using namespace serde::attribute; using Self [[maybe_unused]] = Type; serde::serde_struct ss(context, value); return ss; }
- Before
- NEW: reflection
serde::type_info<T>
Examplestruct A { DERIVE_SERDE(A,_SF_(a)_SF_(b)_SF_(c)) int a; std::string b; std::vector<int> c; }; A a;
- Compile Time Type Convert: Struct -> Tuple
serde::to_tuple_t<A> == std::tuple<int,std::string,std::vector<int>>
- Compile Time Type member variable size: ->
serde::type_info<A>.size == 3
orserde::tuple_size_v<A> == 3
constexpr
member variable name array:serde::type_info<A>.member_names().members() == ["a", "b", "c"]
constexpr
Accessing member variables by index:serde::type_info<A>.member<1>(a) == a.b
constexpr
Accessing member variables by name:serde::type_info<A>.member<std::string>(a, "b"). == a.b
constexpr
Accessing member variable info by index:serde::type_info<A>.member_info<1>(a)
.name()
or.value()
- Compile Time Type Convert: Struct -> Tuple
- Fix: rapidjson Map type key allocate bug
- yaml-cpp: 0.6.3 -> 0.7.0
- New: simple unittest
Full Changelog: v0.1.3.1...v0.1.4