bsl::holds_alternative

Return true if the specified obj currently holds the (template parameter) t_TYPE alternative, and false otherwise. t_TYPE shall appear exactly once in the variant's list of alternatives.

Synopsis

Declared in <bslstl_variant.h>

template<
    class t_TYPE,
    class t_HEAD,
    class... t_TAIL>
bool
holds_alternative(variant<t_HEAD, t_TAIL...> const& obj) noexcept;