<funciones > variant

get

Obtiene la variante de un objeto .

template <size_t I, class... Types>
    constexpr variant_alternative_t<I, variant<Types...>>& get(variant<Types...>&);
template <size_t I, class... Types>
    constexpr variant_alternative_t<I, variant<Types...>>&& get(variant<Types...>&&);
template <size_t I, class... Types>
    constexpr const variant_alternative_t<I, variant<Types...>>& get(const variant<Types...>&);
template <size_t I, class... Types>
    constexpr const variant_alternative_t<I, variant<Types...>>&& get(const variant<Types...>&&);
template <class T, class... Types>
    constexpr T& get(variant<Types...>&);
template <class T, class... Types>
    constexpr T&& get(variant<Types...>&&);
template <class T, class... Types>
    constexpr const T& get(const variant<Types...>&);
template <class T, class... Types>
    constexpr const T&& get(const variant<Types...>&&);

get_if

Obtiene la variante de un objeto si existe.

template <size_t I, class... Types>
    constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>> get_if(variant<Types...>*) noexcept;
template <size_t I, class... Types>
    constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>> get_if(const variant<Types...>*) noexcept;
template <class T, class... Types>
    constexpr add_pointer_t<T> get_if(variant<Types...>*) noexcept;
template <class T, class... Types>
    constexpr add_pointer_t<const T> get_if(const variant<Types...>*) noexcept;

holds_alternative

Devuelve true si existe una variante.

template <class T, class... Types>
    constexpr bool holds_alternative(const variant<Types...>&) noexcept;

swap

template <class... Types>
    void swap(variant<Types...>&, variant<Types...>&) noexcept(see below);

variant_npos

namespace std {
    inline constexpr size_t variant_npos = -1;
}

Visitar

Se desplaza a la siguiente variante.

template <class Visitor, class... Variants>
    constexpr see below
        visit(Visitor&&, Variants&&...);