Skip to content

v0.1.4

Compare
Choose a tag to compare
@injae injae released this 28 Feb 07:55
· 46 commits to main since this release
a9b1da0

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;           
          }                                        
  • NEW: reflection serde::type_info<T> Example
     struct 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 or serde::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()
  • 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