diff --git a/include/boost/serialization/variant.hpp b/include/boost/serialization/variant.hpp index 692276646..b888a5941 100644 --- a/include/boost/serialization/variant.hpp +++ b/include/boost/serialization/variant.hpp @@ -216,7 +216,7 @@ void load( int which; typedef typename boost::variant::types types; ar >> BOOST_SERIALIZATION_NVP(which); - if(which >= sizeof...(Types)){ + if(static_cast(which) >= sizeof...(Types)){ // this might happen if a type was removed from the list of variant types boost::serialization::throw_exception( boost::archive::archive_exception( @@ -238,7 +238,7 @@ void load( int which; typedef typename boost::variant::types types; ar >> BOOST_SERIALIZATION_NVP(which); - if(which >= sizeof...(Types)){ + if(static_cast(which) >= sizeof...(Types)){ // this might happen if a type was removed from the list of variant types boost::serialization::throw_exception( boost::archive::archive_exception(