From 4ff80c642626d33e1845c0ffcb032c076cb04a39 Mon Sep 17 00:00:00 2001 From: Mindaugas Vinkelis Date: Mon, 31 May 2021 08:11:09 +0300 Subject: [PATCH] fix: std::variant access with get_if using index --- include/bitsery/ext/std_variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bitsery/ext/std_variant.h b/include/bitsery/ext/std_variant.h index 2834c34..56c0865 100644 --- a/include/bitsery/ext/std_variant.h +++ b/include/bitsery/ext/std_variant.h @@ -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) { - if (auto item = std::get_if(&data)) { + if (auto item = std::get_if(&data)) { this->serializeType(des, *item); return; }