[#bsl-get_if-0b] = xref:bsl.adoc[bsl]::get_if :relfileprefix: ../ :mrdocs: `get_if` overloads == Synopses Declared in `<bslstl_variant.h>` Return a pointer to the `t_TYPE` alternative in `obj` if active. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> add_pointer<t_TYPE>::type xref:bsl/get_if-06.adoc[get_if](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]* obj) noexcept; ---- [.small]#xref:bsl/get_if-06.adoc[_» more..._]# Return a pointer to the alternative at index `t_INDEX`, or null. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> add_pointer<variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type>::type xref:bsl/get_if-0a.adoc[get_if](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]* obj) noexcept; ---- [.small]#xref:bsl/get_if-0a.adoc[_» more..._]# Return a pointer to the `t_TYPE` alternative in `obj` if active. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> add_pointer<t_TYPE const>::type xref:bsl/get_if-09.adoc[get_if](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const* obj) noexcept; ---- [.small]#xref:bsl/get_if-09.adoc[_» more..._]# Return a pointer to the alternative at index `t_INDEX` in `obj`, or null. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> add_pointer<variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type const>::type xref:bsl/get_if-0d.adoc[get_if](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const* obj) noexcept; ---- [.small]#xref:bsl/get_if-0d.adoc[_» more..._]# == Return Value * pointer to the active `t_TYPE`, or null if inactive * pointer to the alternative at `t_INDEX`, or null * const pointer to the alternative at `t_INDEX`, or null == Parameters [cols="1,4"] |=== | Name| Description | *obj* | variant to query |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#