Closed xushengbo closed 1 year ago
please close this PR.
Thanks for your reply, I got the correct result through the example you gave, but don't know how it all happened. Can you explain the function of yas::init() in detail? Thanks again!!
template<
typename Archive
,typename DT = typename std::decay<T>::type
,bool ok = std::is_fundamental<DT>::value || std::is_enum<DT>::value
>
static Archive& load(Archive &ar, init_wrapper<T> &v, typename std::enable_if<!ok>::type* = nullptr) {
v.val.clear();
return ar & v.val;
}
I got it.Thank you!
you should use
yas::init()
for such cases.the implementation: https://github.com/niXman/yas/blob/master/include/yas/types/utility/init.hpp
example: https://github.com/niXman/yas/blob/master/examples/init/main.cpp#L55