From 6378755e3c612cd870c2720232db1e5423dbbe73 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Tue, 7 Aug 2018 10:56:48 -0700 Subject: [PATCH] fix sign-conversion warnings These appeared when we started using it at work, want to upstream the fix --- include/strict_variant/variant.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/strict_variant/variant.hpp b/include/strict_variant/variant.hpp index eecee63..fc7edfd 100644 --- a/include/strict_variant/variant.hpp +++ b/include/strict_variant/variant.hpp @@ -168,7 +168,7 @@ class variant { // Implementation note: // `detail::true_` here indicates that the visit is internal and we should // NOT pierce `recursive_wrapper`. - return detail::visitor_dispatch{}(m_which, m_storage, + return detail::visitor_dispatch{}(static_cast(m_which), m_storage, visitor); } @@ -406,7 +406,7 @@ class variant { using dispatcher_t = detail::visitor_dispatch; #define APPLY_VISITOR_IMPL_BODY \ - dispatcher_t{}(visitable.which(), std::forward(visitable).m_storage, \ + dispatcher_t{}(static_cast(visitable.which()), std::forward(visitable).m_storage, \ std::forward(visitor)) // Visitable is assumed to be, forwarding reference to this type.