fix: std::variant access with get_if using index

This commit is contained in:
Mindaugas Vinkelis
2021-05-31 08:11:09 +03:00
committed by Mindaugas Vinkelis
parent 126a6c2971
commit 4ff80c6426

View File

@@ -59,7 +59,7 @@ namespace bitsery {
// reference heap data, so if `data` is already holding the requested
// variant then we'll deserialize into the existing object
if constexpr (!std::is_trivial_v<TElem>) {
if (auto item = std::get_if<TElem>(&data)) {
if (auto item = std::get_if<Index>(&data)) {
this->serializeType(des, *item);
return;
}