boostorg / pfr

std::tuple like methods for user defined types without any macro or boilerplate code
https://boost.org/libs/pfr
Boost Software License 1.0
1.34k stars 161 forks source link

Add support for non-aggregate initializable struct #192

Open bansan85 opened 3 days ago

bansan85 commented 3 days ago

Glaze uses a trick to support non-aggregate initializable struct:

template <>
struct glz::meta<my_struct> {
   using T = my_struct;
   static constexpr auto value = object(
      &T::i,
      &T::d,
      &T::hello,
      &T::arr,
      &T::map
   );
};

Maybe pfr could use something like that ?