bsl::is_same

Meta-function for detecting whether two types are the same.

Synopsis

Declared in <bslmf_issame.h>

template<
    class t_TYPE1,
    class t_TYPE2>
struct is_same
    : false_type

Description

This struct template provides a meta-function to determine whether the (template parameter) t_TYPE1 and the (template parameter) t_TYPE2 are the same. This generic default template derives from bsl::false_type. A template specialization is provided (below) that derives from bsl::true_type.

Base Classes

NameDescription
false_typeMetafunction representing the boolean constant false.

Specializations

NameDescription
is_same<t_TYPE, t_TYPE> This partial specialization of is_same derives from bsl::true_type for when the (template parameter) types are the same.

Derived Classes

NameDescription
Variant_IsSameReturnType<t_RET, t_VISITOR, t_VARIANT, 0> Check the return type of invoking t_VISITOR on alternative 0.