|
| constexpr | variant () noexcept(is_nothrow_default_constructible_v< first_type >) |
| |
template<size_t I, typename... Args>
requires ((I < sizeof...(Ts)) and is_constructible_v<variant_alternative_t<I, variant>, Args...>) |
| constexpr | variant (in_place_index_t< I >, Args &&... args) |
| |
template<typename T , typename... Args>
requires (is_constructible_v<T, Args...> and mpl::count_v<remove_cvref_t<T>, mpl::list<Ts...>> == 1) |
| constexpr | variant (in_place_type_t< T >, Args &&... args) |
| |
template<typename T >
requires ( (sizeof...(Ts) > 0) and not is_same_v<remove_cvref_t<T>, variant> and not detail::is_in_place_index<remove_cvref_t<T>> and not detail::is_in_place_type<remove_cvref_t<T>> and is_constructible_v<detail::variant_alternative_selector_t<T, Ts...>, T> ) |
| constexpr | variant (T &&t) noexcept(is_nothrow_constructible_v< detail::variant_alternative_selector_t< T, Ts... >, T >) |
| |
| constexpr | variant (variant &&)=default |
| |
| constexpr | variant (variant &&other) noexcept((... and is_nothrow_move_constructible_v< Ts >)) |
| |
| constexpr | variant (variant const &)=default |
| |
| constexpr | variant (variant const &other) noexcept((... and etl::is_nothrow_copy_constructible_v< Ts >)) |
| |
| constexpr | ~variant () |
| |
| | ~variant ()=default |
| |
template<typename T , typename... Args>
requires (is_constructible_v<T, Args...> and mpl::count_v<T, mpl::list<Ts...>> == 1) |
| constexpr auto | emplace (Args &&... args) -> auto & |
| |
template<size_t I, typename... Args>
requires is_constructible_v<mpl::at_t<I, mpl::list<Ts...>>, Args...> |
| constexpr auto | emplace (Args &&... args) -> auto & |
| |
| constexpr auto | index () const noexcept -> size_t |
| | Returns the zero-based index of the alternative that is currently held by the variant.
|
| |
template<typename T >
requires ( not is_same_v<remove_cvref_t<T>, variant> and is_assignable_v<detail::variant_alternative_selector_t<T, Ts...>&, T> and is_assignable_v<detail::variant_alternative_selector_t<T, Ts...>, T> ) |
| constexpr auto | operator= (T &&t) noexcept((is_nothrow_assignable_v< detail::variant_alternative_selector_t< T, Ts... > &, T > and is_nothrow_constructible_v< detail::variant_alternative_selector_t< T, Ts... >, T >)) -> variant & |
| |
| constexpr auto | operator= (variant &&) -> variant &=default |
| |
| constexpr auto | operator= (variant &&other) noexcept((... and is_nothrow_move_assignable_v< Ts >) and(... and is_nothrow_move_constructible_v< Ts >)) -> variant &requires((... and detail::variant_move_assignable< Ts >) and not(... and detail::variant_trivially_move_assignable< Ts >)) |
| |
| constexpr auto | operator= (variant const &) -> variant &=default |
| |
| constexpr auto | operator= (variant const &other) noexcept((... and is_nothrow_copy_assignable_v< Ts >) and(... and is_nothrow_copy_constructible_v< Ts >)) -> variant &requires((... and detail::variant_copy_assignable< Ts >) and not(... and detail::variant_trivially_copy_assignable< Ts >)) |
| |
| template<size_t I> |
| constexpr auto | operator[] (index_constant< I > index) &&-> auto && |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I> |
| constexpr auto | operator[] (index_constant< I > index) &-> auto & |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I> |
| constexpr auto | operator[] (index_constant< I > index) const &&-> auto const && |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I> |
| constexpr auto | operator[] (index_constant< I > index) const &-> auto const & |
| | Returns a reference to the object stored in the variant.
|
| |
|
(Note that these are not member symbols.)
|
| template<typename T , typename... Ts> |
| constexpr auto | get_if (variant< Ts... > *pv) noexcept -> add_pointer_t< T > |
| | Type-based non-throwing accessor: The call is ill-formed if T is not a unique element of Ts....
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | get_if (variant< Ts... > *pv) noexcept -> add_pointer_t< variant_alternative_t< I, variant< Ts... > > > |
| | If pv is not a null pointer and pv->index() == I, returns a pointer to the value stored in the variant pointed to by pv. Otherwise, returns a null pointer value. The call is ill-formed if I is not a valid index in the variant.
|
| |
| template<typename T , typename... Ts> |
| constexpr auto | get_if (variant< Ts... > const *pv) noexcept -> add_pointer_t< T const > |
| | Type-based non-throwing accessor: The call is ill-formed if T is not a unique element of Ts....
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | get_if (variant< Ts... > const *pv) noexcept -> add_pointer_t< variant_alternative_t< I, variant< Ts... > > const > |
| | If pv is not a null pointer and pv->index() == I, returns a pointer to the value stored in the variant pointed to by pv. Otherwise, returns a null pointer value. The call is ill-formed if I is not a valid index in the variant.
|
| |
| template<typename T , typename... Ts> |
| constexpr auto | holds_alternative (variant< Ts... > const &v) noexcept -> bool |
| | Checks if the variant v holds the alternative T. The call is ill-formed if T does not appear exactly once in Ts...
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | unchecked_get (variant< Ts... > &&v) -> auto && |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | unchecked_get (variant< Ts... > &v) -> auto & |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | unchecked_get (variant< Ts... > const &&v) -> auto const && |
| | Returns a reference to the object stored in the variant.
|
| |
| template<size_t I, typename... Ts> |
| constexpr auto | unchecked_get (variant< Ts... > const &v) -> auto const & |
| | Returns a reference to the object stored in the variant.
|
| |
| template<typename F , typename... Vs> |
| constexpr auto | visit (F &&f, Vs &&... vs) |
| | Applies the visitor vis (Callable that can be called with any combination of types from variants) to the variants vars.
|
| |
| template<typename F , typename... Vs> |
| constexpr auto | visit_with_index (F &&f, Vs &&... vs) |
| | Applies the visitor vis (Callable that can be called with any combination of types from variants) to the variants vars.
|
| |