tmp/tmpzwvw6r2a/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Header `<variant>` synopsis <a id="variant.syn">[[variant.syn]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
// [variant.variant], class template variant
|
| 6 |
+
template <class... Types>
|
| 7 |
+
class variant;
|
| 8 |
+
|
| 9 |
+
// [variant.helper], variant helper classes
|
| 10 |
+
template <class T> struct variant_size; // not defined
|
| 11 |
+
template <class T> struct variant_size<const T>;
|
| 12 |
+
template <class T> struct variant_size<volatile T>;
|
| 13 |
+
template <class T> struct variant_size<const volatile T>;
|
| 14 |
+
template <class T>
|
| 15 |
+
inline constexpr size_t variant_size_v = variant_size<T>::value;
|
| 16 |
+
|
| 17 |
+
template <class... Types>
|
| 18 |
+
struct variant_size<variant<Types...>>;
|
| 19 |
+
|
| 20 |
+
template <size_t I, class T> struct variant_alternative; // not defined
|
| 21 |
+
template <size_t I, class T> struct variant_alternative<I, const T>;
|
| 22 |
+
template <size_t I, class T> struct variant_alternative<I, volatile T>;
|
| 23 |
+
template <size_t I, class T> struct variant_alternative<I, const volatile T>;
|
| 24 |
+
template <size_t I, class T>
|
| 25 |
+
using variant_alternative_t = typename variant_alternative<I, T>::type;
|
| 26 |
+
|
| 27 |
+
template <size_t I, class... Types>
|
| 28 |
+
struct variant_alternative<I, variant<Types...>>;
|
| 29 |
+
|
| 30 |
+
inline constexpr size_t variant_npos = -1;
|
| 31 |
+
|
| 32 |
+
// [variant.get], value access
|
| 33 |
+
template <class T, class... Types>
|
| 34 |
+
constexpr bool holds_alternative(const variant<Types...>&) noexcept;
|
| 35 |
+
|
| 36 |
+
template <size_t I, class... Types>
|
| 37 |
+
constexpr variant_alternative_t<I, variant<Types...>>& get(variant<Types...>&);
|
| 38 |
+
template <size_t I, class... Types>
|
| 39 |
+
constexpr variant_alternative_t<I, variant<Types...>>&& get(variant<Types...>&&);
|
| 40 |
+
template <size_t I, class... Types>
|
| 41 |
+
constexpr const variant_alternative_t<I, variant<Types...>>& get(const variant<Types...>&);
|
| 42 |
+
template <size_t I, class... Types>
|
| 43 |
+
constexpr const variant_alternative_t<I, variant<Types...>>&& get(const variant<Types...>&&);
|
| 44 |
+
|
| 45 |
+
template <class T, class... Types>
|
| 46 |
+
constexpr T& get(variant<Types...>&);
|
| 47 |
+
template <class T, class... Types>
|
| 48 |
+
constexpr T&& get(variant<Types...>&&);
|
| 49 |
+
template <class T, class... Types>
|
| 50 |
+
constexpr const T& get(const variant<Types...>&);
|
| 51 |
+
template <class T, class... Types>
|
| 52 |
+
constexpr const T&& get(const variant<Types...>&&);
|
| 53 |
+
|
| 54 |
+
template <size_t I, class... Types>
|
| 55 |
+
constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>>
|
| 56 |
+
get_if(variant<Types...>*) noexcept;
|
| 57 |
+
template <size_t I, class... Types>
|
| 58 |
+
constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>>
|
| 59 |
+
get_if(const variant<Types...>*) noexcept;
|
| 60 |
+
|
| 61 |
+
template <class T, class... Types>
|
| 62 |
+
constexpr add_pointer_t<T>
|
| 63 |
+
get_if(variant<Types...>*) noexcept;
|
| 64 |
+
template <class T, class... Types>
|
| 65 |
+
constexpr add_pointer_t<const T>
|
| 66 |
+
get_if(const variant<Types...>*) noexcept;
|
| 67 |
+
|
| 68 |
+
// [variant.relops], relational operators
|
| 69 |
+
template <class... Types>
|
| 70 |
+
constexpr bool operator==(const variant<Types...>&, const variant<Types...>&);
|
| 71 |
+
template <class... Types>
|
| 72 |
+
constexpr bool operator!=(const variant<Types...>&, const variant<Types...>&);
|
| 73 |
+
template <class... Types>
|
| 74 |
+
constexpr bool operator<(const variant<Types...>&, const variant<Types...>&);
|
| 75 |
+
template <class... Types>
|
| 76 |
+
constexpr bool operator>(const variant<Types...>&, const variant<Types...>&);
|
| 77 |
+
template <class... Types>
|
| 78 |
+
constexpr bool operator<=(const variant<Types...>&, const variant<Types...>&);
|
| 79 |
+
template <class... Types>
|
| 80 |
+
constexpr bool operator>=(const variant<Types...>&, const variant<Types...>&);
|
| 81 |
+
|
| 82 |
+
// [variant.visit], visitation
|
| 83 |
+
template <class Visitor, class... Variants>
|
| 84 |
+
constexpr see below visit(Visitor&&, Variants&&...);
|
| 85 |
+
|
| 86 |
+
// [variant.monostate], class monostate
|
| 87 |
+
struct monostate;
|
| 88 |
+
|
| 89 |
+
// [variant.monostate.relops], monostate relational operators
|
| 90 |
+
constexpr bool operator<(monostate, monostate) noexcept;
|
| 91 |
+
constexpr bool operator>(monostate, monostate) noexcept;
|
| 92 |
+
constexpr bool operator<=(monostate, monostate) noexcept;
|
| 93 |
+
constexpr bool operator>=(monostate, monostate) noexcept;
|
| 94 |
+
constexpr bool operator==(monostate, monostate) noexcept;
|
| 95 |
+
constexpr bool operator!=(monostate, monostate) noexcept;
|
| 96 |
+
|
| 97 |
+
// [variant.specalg], specialized algorithms
|
| 98 |
+
template <class... Types>
|
| 99 |
+
void swap(variant<Types...>&, variant<Types...>&) noexcept(see below);
|
| 100 |
+
|
| 101 |
+
// [variant.bad.access], class bad_variant_access
|
| 102 |
+
class bad_variant_access;
|
| 103 |
+
|
| 104 |
+
// [variant.hash], hash support
|
| 105 |
+
template <class T> struct hash;
|
| 106 |
+
template <class... Types> struct hash<variant<Types...>>;
|
| 107 |
+
template <> struct hash<monostate>;
|
| 108 |
+
|
| 109 |
+
// [variant.traits], allocator-related traits
|
| 110 |
+
template <class T, class Alloc> struct uses_allocator;
|
| 111 |
+
template <class... Types, class Alloc> struct uses_allocator<variant<Types...>, Alloc>;
|
| 112 |
+
}
|
| 113 |
+
```
|
| 114 |
+
|