{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v);
}
{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(
std::move(__v));
}
{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v);
}
{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(
std::move(__v));
}
{
using _Alternative_type = variant_alternative_t<_Np, variant<_Types...>>;
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
- static_assert(!is_void_v<_Alternative_type>, "_Tp should not be void");
+ "The index must be in [0, number of alternatives)");
+ static_assert(!is_void_v<_Alternative_type>, "_Tp must not be void");
if (__ptr && __ptr->index() == _Np)
return std::addressof(__detail::__variant::__get<_Np>(*__ptr));
return nullptr;
{
using _Alternative_type = variant_alternative_t<_Np, variant<_Types...>>;
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
- static_assert(!is_void_v<_Alternative_type>, "_Tp should not be void");
+ "The index must be in [0, number of alternatives)");
+ static_assert(!is_void_v<_Alternative_type>, "_Tp must not be void");
if (__ptr && __ptr->index() == _Np)
return std::addressof(__detail::__variant::__get<_Np>(*__ptr));
return nullptr;
{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(
__ptr);
}
{
static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
"T must occur exactly once in alternatives");
- static_assert(!is_void_v<_Tp>, "_Tp should not be void");
+ static_assert(!is_void_v<_Tp>, "_Tp must not be void");
return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(
__ptr);
}
emplace(_Args&&... __args)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
using type = variant_alternative_t<_Np, variant>;
// Provide the strong exception-safety guarantee when possible,
// to avoid becoming valueless.
emplace(initializer_list<_Up> __il, _Args&&... __args)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
using type = variant_alternative_t<_Np, variant>;
// Provide the strong exception-safety guarantee when possible,
// to avoid becoming valueless.
get(variant<_Types...>& __v)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
if (__v.index() != _Np)
__throw_bad_variant_access(__v.valueless_by_exception());
return __detail::__variant::__get<_Np>(__v);
get(variant<_Types...>&& __v)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
if (__v.index() != _Np)
__throw_bad_variant_access(__v.valueless_by_exception());
return __detail::__variant::__get<_Np>(std::move(__v));
get(const variant<_Types...>& __v)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
if (__v.index() != _Np)
__throw_bad_variant_access(__v.valueless_by_exception());
return __detail::__variant::__get<_Np>(__v);
get(const variant<_Types...>&& __v)
{
static_assert(_Np < sizeof...(_Types),
- "The index should be in [0, number of alternatives)");
+ "The index must be in [0, number of alternatives)");
if (__v.index() != _Np)
__throw_bad_variant_access(__v.valueless_by_exception());
return __detail::__variant::__get<_Np>(std::move(__v));
using argument_type [[__deprecated__]] = monostate;
size_t
- operator()(const monostate& __t) const noexcept
+ operator()(const monostate&) const noexcept
{
constexpr size_t __magic_monostate_hash = -7777;
return __magic_monostate_hash;