[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __fwd / variant.h
blob71c792f46a901992baf9162a11edc96777ce9138
1 //===---------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===---------------------------------------------------------------------===//
9 #ifndef _LIBCPP___FWD_VARIANT_H
10 #define _LIBCPP___FWD_VARIANT_H
12 #include <__config>
13 #include <__cstddef/size_t.h>
15 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16 # pragma GCC system_header
17 #endif
19 _LIBCPP_BEGIN_NAMESPACE_STD
21 #if _LIBCPP_STD_VER >= 17
23 template <class... _Types>
24 class _LIBCPP_TEMPLATE_VIS variant;
26 template <class _Tp>
27 struct _LIBCPP_TEMPLATE_VIS variant_size;
29 template <class _Tp>
30 inline constexpr size_t variant_size_v = variant_size<_Tp>::value;
32 template <size_t _Ip, class _Tp>
33 struct _LIBCPP_TEMPLATE_VIS variant_alternative;
35 template <size_t _Ip, class _Tp>
36 using variant_alternative_t = typename variant_alternative<_Ip, _Tp>::type;
38 inline constexpr size_t variant_npos = static_cast<size_t>(-1);
40 template <size_t _Ip, class... _Types>
41 _LIBCPP_HIDE_FROM_ABI
42 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&
43 get(variant<_Types...>&);
45 template <size_t _Ip, class... _Types>
46 _LIBCPP_HIDE_FROM_ABI
47 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&&
48 get(variant<_Types...>&&);
50 template <size_t _Ip, class... _Types>
51 _LIBCPP_HIDE_FROM_ABI
52 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&
53 get(const variant<_Types...>&);
55 template <size_t _Ip, class... _Types>
56 _LIBCPP_HIDE_FROM_ABI
57 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&&
58 get(const variant<_Types...>&&);
60 template <class _Tp, class... _Types>
61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp& get(variant<_Types...>&);
63 template <class _Tp, class... _Types>
64 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp&& get(variant<_Types...>&&);
66 template <class _Tp, class... _Types>
67 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp& get(const variant<_Types...>&);
69 template <class _Tp, class... _Types>
70 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp&&
71 get(const variant<_Types...>&&);
73 #endif // _LIBCPP_STD_VER >= 17
75 _LIBCPP_END_NAMESPACE_STD
77 #endif // _LIBCPP___FWD_VARIANT_H