template<typename... _Types>
struct _Variant_storage<false, _Types...>
{
- constexpr _Variant_storage() : _M_index(variant_npos) { }
+ constexpr
+ _Variant_storage()
+ : _M_index(static_cast<__index_type>(variant_npos))
+ { }
template<size_t _Np, typename... _Args>
- constexpr _Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
+ constexpr
+ _Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
: _M_u(in_place_index<_Np>, std::forward<_Args>(__args)...),
- _M_index(_Np)
+ _M_index{_Np}
{ }
void _M_reset()
std::_Destroy(std::__addressof(__this_mem));
}, __variant_cast<_Types...>(*this));
- _M_index = variant_npos;
+ _M_index = static_cast<__index_type>(variant_npos);
}
~_Variant_storage()
template<typename... _Types>
struct _Variant_storage<true, _Types...>
{
- constexpr _Variant_storage() : _M_index(variant_npos) { }
+ constexpr
+ _Variant_storage()
+ : _M_index(static_cast<__index_type>(variant_npos))
+ { }
template<size_t _Np, typename... _Args>
- constexpr _Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
+ constexpr
+ _Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
: _M_u(in_place_index<_Np>, std::forward<_Args>(__args)...),
- _M_index(_Np)
+ _M_index{_Np}
{ }
void _M_reset() noexcept
- { _M_index = variant_npos; }
+ { _M_index = static_cast<__index_type>(variant_npos); }
void*
_M_storage() const noexcept
{
if constexpr (__variant::__never_valueless<_Types...>())
return true;
- return this->_M_index != __index_type(variant_npos);
+ return this->_M_index != static_cast<__index_type>(variant_npos);
}
_Variadic_union<_Types...> _M_u;