diff --git a/runtime/src/zserio/Variant.h b/runtime/src/zserio/Variant.h index bbe8c5e..89f7a70 100644 --- a/runtime/src/zserio/Variant.h +++ b/runtime/src/zserio/Variant.h @@ -513,11 +513,11 @@ class BasicVariant : public AllocatorHolder } if constexpr (std::is_same_v) { - std::forward(fun)(get()); + std::forward(fun)(get(I)>()); } else { - returnValue = std::forward(fun)(get()); + returnValue = std::forward(fun)(get(I)>()); } } @@ -530,11 +530,11 @@ class BasicVariant : public AllocatorHolder } if constexpr (std::is_same_v) { - std::forward(fun)(get()); + std::forward(fun)(get(I)>()); } else { - returnValue = std::forward(fun)(get()); + returnValue = std::forward(fun)(get(I)>()); } } @@ -551,7 +551,7 @@ class BasicVariant : public AllocatorHolder { return true; } - return get() == other.get(); + return get(I)>() == other.get(I)>(); } template @@ -567,7 +567,7 @@ class BasicVariant : public AllocatorHolder { return true; } - return get() < other.get(); + return get(I)>() < other.get(I)>(); } template @@ -624,7 +624,7 @@ class BasicVariant : public AllocatorHolder { return; } - emplace(other.get()); + emplace(I)>(other.get(I)>()); } void move(BasicVariant&& other) diff --git a/runtime/test/zserio/VariantTest.cpp b/runtime/test/zserio/VariantTest.cpp index 79c72a4..820d52c 100644 --- a/runtime/test/zserio/VariantTest.cpp +++ b/runtime/test/zserio/VariantTest.cpp @@ -38,7 +38,7 @@ struct BigObj explicit BigObj(char obj) : data() // make clang-tidy happy { - data[0] = (char)obj; + data[0] = obj; } char value() const {