Return a reference to the alternative object at index (template parameter) t_INDEX in the specified obj. If t_INDEX is not the index of the currently active alternative, throw an exception of type bad_variant_access. t_INDEX shall be a valid index for the variant type of obj.

Synopsis

Declared in <bslstl_variant.h>

template<
    std::size_t t_INDEX,
    class t_HEAD,
    class... t_TAIL>
variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type&
get(variant<t_HEAD, t_TAIL...>& obj);

Created with MrDocs