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 >
using std::__detail::__variant::__get_t = decltype(std::get< _Np >(std::declval< _Variant >()))
 
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 _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, typename _Variant >
constexpr decltype(auto) std::__detail::__variant::__get (_Variant &&__v) noexcept
 
template<typename _Union >
constexpr decltype(auto) std::__detail::__variant::__get (in_place_index_t< 0 >, _Union &&__u) noexcept
 
template<size_t _Np, typename _Union >
constexpr decltype(auto) std::__detail::__variant::__get (in_place_index_t< _Np >, _Union &&__u) noexcept
 
template<typename _Variant >
void * std::__detail::__variant::__get_storage (_Variant &&__v) 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 >
decltype(auto) std::__variant_cast (_Tp &&__rhs)
 
template<typename... _Types, typename _Tp , typename _Up >
void std::__detail::__variant::__variant_construct (_Tp &&__lhs, _Up &&__rhs)
 
template<size_t _Np, typename _Variant , typename... _Args>
void std::__variant_construct_by_index (_Variant &__v, _Args &&... __args)
 
template<typename _Tp , typename _Up >
void std::__detail::__variant::__variant_construct_single (_Tp &&__lhs, _Up &&__rhs_mem)
 
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>
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)
 

Variables

template<typename _Tp , typename... _Types>
constexpr bool std::__detail::__variant::__exactly_once
 
template<typename _Tp , typename... _Types>
constexpr size_t std::__detail::__variant::__index_of_v
 
template<typename _Tp , typename... _Types>
constexpr bool std::__detail::__variant::__same_types
 
template<typename _Tp , typename _Tuple >
constexpr size_t std::__detail::__variant::__tuple_count_v
 
__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
 

Detailed Description

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

Definition in file variant.