Closed jfirebaugh closed 7 years ago
Could you give more context so that we know what lhs and rhs are?
Sure -- as far as I can tell (not super familiar with the implementation), this warning will occur regardless of the alternative types of the actual variant
in use, because the lhs
and rhs
involved here are internal to the implementation. The error location is here, so:
lhs
is mpark::detail::constructor<Traits>
and lhs.index_
is unsigned int index_
from base
rhs
is a templated type, but I'm guessing it's also some instantation of base
, meaning rhs.index()
is base::index()
, returning std::size_t
.Thanks for reporting this @jfirebaugh! I've fixed this in https://github.com/mpark/variant/commit/d8fd0fbba727f0f2f757a05ae7a86e14c3b5982c
When compiling with
-Wshorten-64-to-32
on platforms wherestd::size_t
isunsigned long
, many warnings of the following form are produced: