[#bsl-get-0b5] = xref:bsl.adoc[bsl]::get :relfileprefix: ../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type& get(xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]& obj); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#