#ifndef _LIBCPP_VARIANT
#define _LIBCPP_VARIANT
#include <__compare/common_comparison_category.h>
#include <__compare/compare_three_way_result.h>
#include <__compare/three_way_comparable.h>
#include <__config>
#include <__exception/exception.h>
#include <__functional/hash.h>
#include <__functional/invoke.h>
#include <__functional/operations.h>
#include <__functional/unary_function.h>
#include <__memory/addressof.h>
#include <__memory/construct_at.h>
#include <__tuple/find_index.h>
#include <__tuple/sfinae_helpers.h>
#include <__type_traits/add_const.h>
#include <__type_traits/add_cv.h>
#include <__type_traits/add_pointer.h>
#include <__type_traits/add_volatile.h>
#include <__type_traits/common_type.h>
#include <__type_traits/conjunction.h>
#include <__type_traits/dependent_type.h>
#include <__type_traits/is_array.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/is_destructible.h>
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/is_trivially_assignable.h>
#include <__type_traits/is_trivially_constructible.h>
#include <__type_traits/is_trivially_destructible.h>
#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/is_void.h>
#include <__type_traits/remove_const.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/type_identity.h>
#include <__type_traits/void_t.h>
#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/forward_like.h>
#include <__utility/in_place.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__variant/monostate.h>
#include <__verbose_abort>
#include <initializer_list>
#include <limits>
#include <new>
#include <version>
#include <compare>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
namespace std {
class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS bad_variant_access : public exception { … };
}
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
template <class _Tp, size_t _Size>
struct __farray { … };
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS void
__throw_bad_variant_access() { … }
template <class... _Types>
class _LIBCPP_TEMPLATE_VIS variant;
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS variant_size;
variant_size_v;
variant_size<const _Tp>;
variant_size<volatile _Tp>;
variant_size<const volatile _Tp>;
variant_size<variant<_Types...>>;
template <size_t _Ip, class _Tp>
struct _LIBCPP_TEMPLATE_VIS variant_alternative;
variant_alternative_t;
variant_alternative<_Ip, const _Tp>;
variant_alternative<_Ip, volatile _Tp>;
variant_alternative<_Ip, const volatile _Tp>;
variant_alternative<_Ip, variant<_Types...>>;
inline constexpr size_t variant_npos = …;
template <size_t _NumAlternatives>
_LIBCPP_HIDE_FROM_ABI constexpr auto __choose_index_type() { … }
__variant_index_t;
__variant_npos;
template <class... _Types>
class _LIBCPP_TEMPLATE_VIS variant;
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr variant<_Types...>& __as_variant(variant<_Types...>& __vs) noexcept { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr const variant<_Types...>& __as_variant(const variant<_Types...>& __vs) noexcept { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr variant<_Types...>&& __as_variant(variant<_Types...>&& __vs) noexcept { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr const variant<_Types...>&& __as_variant(const variant<_Types...>&& __vs) noexcept { … }
namespace __find_detail {
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr size_t __find_index() { … }
template <size_t _Index>
struct __find_unambiguous_index_sfinae_impl : integral_constant<size_t, _Index> { … };
template <>
struct __find_unambiguous_index_sfinae_impl<__not_found> { … };
template <>
struct __find_unambiguous_index_sfinae_impl<__ambiguous> { … };
template <class _Tp, class... _Types>
struct __find_unambiguous_index_sfinae : __find_unambiguous_index_sfinae_impl<__find_index<_Tp, _Types...>()> { … };
}
__variant_detail
template <class _Visitor, class... _Vs, typename = void_t<decltype(std::__as_variant(std::declval<_Vs>()))...>>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr decltype(auto)
visit(_Visitor&& __visitor, _Vs&&... __vs);
# if _LIBCPP_STD_VER >= 20
template <class _Rp,
class _Visitor,
class... _Vs,
typename = void_t<decltype(std::__as_variant(std::declval<_Vs>()))...>>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Rp
visit(_Visitor&& __visitor, _Vs&&... __vs);
# endif
template <class... _Types>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DECLSPEC_EMPTY_BASES variant
: private __sfinae_ctor_base< __all<is_copy_constructible_v<_Types>...>::value,
__all<is_move_constructible_v<_Types>...>::value>,
private __sfinae_assign_base<
__all<(is_copy_constructible_v<_Types> && is_copy_assignable_v<_Types>)...>::value,
__all<(is_move_constructible_v<_Types> && is_move_assignable_v<_Types>)...>::value> { … };
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool __holds_alternative(const variant<_Types...>& __v) noexcept { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept { … }
template <size_t _Ip, class _Vp>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr auto&& __generic_get(_Vp&& __v) { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&
get(variant<_Types...>& __v) { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&&
get(variant<_Types...>&& __v) { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&
get(const variant<_Types...>& __v) { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&&
get(const variant<_Types...>&& __v) { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp& get(variant<_Types...>& __v) { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp&& get(variant<_Types...>&& __v) { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp&
get(const variant<_Types...>& __v) { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp&&
get(const variant<_Types...>&& __v) { … }
template <size_t _Ip, class _Vp>
_LIBCPP_HIDE_FROM_ABI constexpr auto* __generic_get_if(_Vp* __v) noexcept { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<variant_alternative_t<_Ip, variant<_Types...>>>
get_if(variant<_Types...>* __v) noexcept { … }
template <size_t _Ip, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const variant_alternative_t<_Ip, variant<_Types...>>>
get_if(const variant<_Types...>* __v) noexcept { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> get_if(variant<_Types...>* __v) noexcept { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<const _Tp> get_if(const variant<_Types...>* __v) noexcept { … }
template <class _Operator>
struct __convert_to_bool { … };
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
# if _LIBCPP_STD_VER >= 20
template <class... _Types>
requires(three_way_comparable<_Types> && ...)
_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t<compare_three_way_result_t<_Types>...>
operator<=>(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
# endif
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) { … }
template <class... _Vs>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr void __throw_if_valueless(_Vs&&... __vs) { … }
template < class _Visitor, class... _Vs, typename>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr decltype(auto)
visit(_Visitor&& __visitor, _Vs&&... __vs) { … }
# if _LIBCPP_STD_VER >= 20
template < class _Rp, class _Visitor, class... _Vs, typename>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Rp
visit(_Visitor&& __visitor, _Vs&&... __vs) { … }
# endif
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto
swap(variant<_Types...>& __lhs,
variant<_Types...>& __rhs) noexcept(noexcept(__lhs.swap(__rhs))) -> decltype(__lhs.swap(__rhs)) { … }
hash<__enable_hash_helper<variant<_Types...>, remove_const_t<_Types>...>>;
template <size_t _Ip, class _Vp>
_LIBCPP_HIDE_FROM_ABI constexpr auto&& __unchecked_get(_Vp&& __v) noexcept { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr auto&& __unchecked_get(const variant<_Types...>& __v) noexcept { … }
template <class _Tp, class... _Types>
_LIBCPP_HIDE_FROM_ABI constexpr auto&& __unchecked_get(variant<_Types...>& __v) noexcept { … }
#endif
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <exception>
# include <tuple>
# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
#endif