get_if overloads
Synopses
Declared in <bslstl_variant.h>
Return a pointer to the t_TYPE alternative in obj if active.
template<
class t_TYPE,
class t_HEAD,
class... t_TAIL>
add_pointer<t_TYPE>::type
get_if(variant<t_HEAD, t_TAIL...>* obj) noexcept;
Return a pointer to the alternative at index t_INDEX, or null.
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
get_if(variant<t_HEAD, t_TAIL...>* obj) noexcept;
Return a pointer to the t_TYPE alternative in obj if active.
template<
class t_TYPE,
class t_HEAD,
class... t_TAIL>
add_pointer<t_TYPE const>::type
get_if(variant<t_HEAD, t_TAIL...> const* obj) noexcept;
Return a pointer to the alternative at index t_INDEX in obj, or null.
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
get_if(variant<t_HEAD, t_TAIL...> const* obj) noexcept;
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
Name |
Description |
obj |
variant to query |
Created with MrDocs