libstdc++
variant File Reference

Go to the source code of this file.

Namespaces

 std
 
 std::__detail
 

Macros

#define __cpp_lib_variant
 
#define _GLIBCXX_VARIANT
 
#define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP)
 
#define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP, __NAME)
 

Typedefs

template<size_t _Np, typename _Variant , typename _AsV = decltype(__variant::__as(std::declval<_Variant>())), typename _Tp = variant_alternative_t<_Np, remove_reference_t<_AsV>>>
using std::__detail::__variant::__get_t = __conditional_t< is_lvalue_reference_v< _Variant >, _Tp &, _Tp && >
 
using std::__detail::__variant::__index_type = __select_index< _Types... >
 
template<typename _Visitor , typename... _Variants>
using std::__detail::__variant::__visit_result_t = invoke_result_t< _Visitor, __get_t< 0, _Variants >... >
 
template<typename... _Types>
using std::__detail::__variant::_Copy_assign_alias = _Copy_assign_base< _Traits< _Types... >::_S_trivial_copy_assign, _Types... >
 
template<typename... _Types>
using std::__detail::__variant::_Copy_ctor_alias = _Copy_ctor_base< _Traits< _Types... >::_S_trivial_copy_ctor, _Types... >
 
template<typename _Tp , typename _Variant >
using std::__detail::__variant::_FUN_type = decltype(_Build_FUNs< _Tp, _Variant >::_S_fun(std::declval< _Tp >()))
 
template<typename... _Types>
using std::__detail::__variant::_Move_assign_alias = _Move_assign_base< _Traits< _Types... >::_S_trivial_move_assign, _Types... >
 
template<typename... _Types>
using std::__detail::__variant::_Move_ctor_alias = _Move_ctor_base< _Traits< _Types... >::_S_trivial_move_ctor, _Types... >
 
template<typename... _Types>
using std::__detail::__variant::_Variant_storage_alias = _Variant_storage< _Traits< _Types... >::_S_trivial_dtor, _Types... >
 
template<size_t _Np, typename _Variant >
using std::variant_alternative_t = typename variant_alternative< _Np, _Variant >::type
 

Functions

template<typename... _Types>
constexpr const std::variant< _Types... > && std::__detail::__variant::__as (const std::variant< _Types... > &&__v) noexcept
 
template<typename... _Types>
constexpr const std::variant< _Types... > & std::__detail::__variant::__as (const std::variant< _Types... > &__v) noexcept
 
template<typename... _Types>
constexpr std::variant< _Types... > && std::__detail::__variant::__as (std::variant< _Types... > &&__v) noexcept
 
template<typename... _Types>
constexpr std::variant< _Types... > & std::__detail::__variant::__as (std::variant< _Types... > &__v) noexcept
 
template<typename _Visitor , typename _Variant , size_t... _Idxs>
constexpr bool std::__detail::__variant::__check_visitor_results (std::index_sequence< _Idxs... >)
 
template<typename _Result_type , typename _Visitor , typename... _Variants>
constexpr decltype(auto) std::__do_visit (_Visitor &&__visitor, _Variants &&... __variants)
 
template<size_t _Np, bool _Triv, typename... _Types, typename... _Args>
constexpr void std::__detail::__variant::__emplace (_Variant_storage< _Triv, _Types... > &__v, _Args &&... __args)
 
template<size_t _Np, typename _Variant >
constexpr decltype(auto) std::__detail::__variant::__get (_Variant &&__v) noexcept
 
template<size_t _Np, typename _Union >
constexpr decltype(auto) std::__detail::__variant::__get_n (_Union &&__u) noexcept
 
template<typename _Visitor , typename... _Variants>
constexpr void std::__detail::__variant::__raw_idx_visit (_Visitor &&__visitor, _Variants &&... __variants)
 
template<typename _Visitor , typename... _Variants>
constexpr void std::__detail::__variant::__raw_visit (_Visitor &&__visitor, _Variants &&... __variants)
 
void std::__throw_bad_variant_access (bool __valueless)
 
void std::__throw_bad_variant_access (const char *__what)
 
template<typename... _Types, typename _Tp >
constexpr decltype(auto) std::__variant_cast (_Tp &&__rhs)
 
template<size_t _Np, typename... _Types>
constexpr variant_alternative_t< _Np, variant< _Types... > > const && std::get (const variant< _Types... > &&)
 
template<typename _Tp , typename... _Types>
constexpr const _Tp && std::get (const variant< _Types... > &&__v)
 
template<size_t _Np, typename... _Types>
constexpr const variant_alternative_t< _Np, variant< _Types... > > && std::get (const variant< _Types... > &&__v)
 
template<size_t _Np, typename... _Types>
constexpr variant_alternative_t< _Np, variant< _Types... > > const & std::get (const variant< _Types... > &)
 
template<typename _Tp , typename... _Types>
constexpr const _Tp & std::get (const variant< _Types... > &__v)
 
template<size_t _Np, typename... _Types>
constexpr const variant_alternative_t< _Np, variant< _Types... > > & std::get (const variant< _Types... > &__v)
 
template<size_t _Np, typename... _Types>
constexpr variant_alternative_t< _Np, variant< _Types... > > && std::get (variant< _Types... > &&)
 
template<typename _Tp , typename... _Types>
constexpr _Tp && std::get (variant< _Types... > &&__v)
 
template<size_t _Np, typename... _Types>
constexpr variant_alternative_t< _Np, variant< _Types... > > & std::get (variant< _Types... > &)
 
template<typename _Tp , typename... _Types>
constexpr _Tp & std::get (variant< _Types... > &__v)
 
template<size_t _Np, typename... _Types>
constexpr add_pointer_t< const variant_alternative_t< _Np, variant< _Types... > > > std::get_if (const variant< _Types... > *__ptr) noexcept
 
template<typename _Tp , typename... _Types>
constexpr add_pointer_t< const _Tp > std::get_if (const variant< _Types... > *__ptr) noexcept
 
template<size_t _Np, typename... _Types>
constexpr add_pointer_t< variant_alternative_t< _Np, variant< _Types... > > > std::get_if (variant< _Types... > *__ptr) noexcept
 
template<typename _Tp , typename... _Types>
constexpr add_pointer_t< _Tp > std::get_if (variant< _Types... > *__ptr) noexcept
 
template<typename _Tp , typename... _Types>
constexpr bool std::holds_alternative (const variant< _Types... > &__v) noexcept
 
template<typename... _Types>
constexpr bool std::operator!= (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator!= (monostate, monostate) noexcept
 
template<typename... _Types>
constexpr bool std::operator< (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator< (monostate, monostate) noexcept
 
template<typename... _Types>
constexpr bool std::operator<= (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator<= (monostate, monostate) noexcept
 
template<typename... _Types>
constexpr bool std::operator== (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator== (monostate, monostate) noexcept
 
template<typename... _Types>
constexpr bool std::operator> (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator> (monostate, monostate) noexcept
 
template<typename... _Types>
constexpr bool std::operator>= (const variant< _Types... > &__lhs, const variant< _Types... > &__rhs)
 
constexpr bool std::operator>= (monostate, monostate) noexcept
 
template<typename... _Types>
enable_if_t<!((is_move_constructible_v< _Types > &&...) &&(is_swappable_v< _Types > &&...))> std::swap (variant< _Types... > &, variant< _Types... > &)=delete
 
template<typename... _Types>
constexpr enable_if_t<(is_move_constructible_v< _Types > &&...) &&(is_swappable_v< _Types > &&...)> std::swap (variant< _Types... > &__lhs, variant< _Types... > &__rhs) noexcept(noexcept(__lhs.swap(__rhs)))
 
template<typename _Visitor , typename... _Variants>
constexpr __detail::__variant::__visit_result_t< _Visitor, _Variants... > std::visit (_Visitor &&, _Variants &&...)
 
template<typename _Visitor , typename... _Variants>
constexpr __detail::__variant::__visit_result_t< _Visitor, _Variants... > std::visit (_Visitor &&__visitor, _Variants &&... __variants)
 
template<typename _Res , typename _Visitor , typename... _Variants>
constexpr _Res std::visit (_Visitor &&__visitor, _Variants &&... __variants)
 

Variables

template<typename _Tp , typename... _Types>
constexpr bool std::__detail::__variant::__exactly_once
 
template<typename _Tp , typename... _Types>
constexpr bool std::__detail::__variant::__same_types
 
__index_type std::__detail::__variant::_M_index
 
template<typename _Tp >
_Variadic_union< _Types... > std::__detail::__variant::_M_u
 
constexpr size_t std::variant_npos
 
template<typename _Variant >
constexpr size_t std::variant_size_v
 
template<typename... _Types>
constexpr size_t std::variant_size_v< const variant< _Types... > >
 
template<typename... _Types>
constexpr size_t std::variant_size_v< variant< _Types... > >
 

Detailed Description

This is the <variant> C++ Library header.

Definition in file variant.