Closed GIGte closed 2 years ago
hi,
unfortunately I have no macOS and you didn't provide me an error message.
so should I just add #include <cstdint>
?
$ clang++ main.cpp -Iyas-master/include -std=c++17
#include <yas/serialize.hpp>
#include <yas/std_types.hpp>
int main() {
std::variant<int> v{0};
auto buf = yas::save<yas::mem | yas::json>(v);
return 0;
}
It works when I replace std::size_t idx
with std::uint8_t idx
.
I think this is related to https://github.com/niXman/yas/issues/79#issuecomment-932990242
ah, got it! thanks! will fix it soon!
done: https://github.com/niXman/yas/commit/74f631061da84ddbfd8a9b1df6603642c1412bfd
please test and report.
Builds now, thanks!
std::size_t
is used in the JSON serialization ofstd::variant
. See this line: https://github.com/niXman/yas/blob/cba47df0a91393d3e9a269792710ab50a9b51375/include/yas/types/std/variant.hpp#L129 yas tries to serializestd::size_t
asyas::object
, and this fails to build on macOS. The problem is for both saving and loading.