Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

are_same

template <typename... O>
struct are_same : public true_type-or-false_type {};

Inherits: If T and U are the same types for each U in {O\T} then inherits from true_type, otherwise inherits from false_type.

Header: #include <boost/type_traits/are_same.hpp> or #include <boost/type_traits.hpp>

Compiler Compatibility: If the compiler does not support variadic templates, then this template accepts only two arguments and it acts like is_same.

Examples:

are_same<int, int> inherits from true_type.

are_same<int, int, int> inherits from true_type.

are_same<int, int>::type is the type true_type.

are_same<int, int, int>::type is the type true_type.

are_same<int, int>::value is an integral constant expression that evaluates to true.

are_same<int, int, int>::value is an integral constant expression that evaluates to true.

are_same<int const, int>::value is an integral constant expression that evaluates to false.

are_same<int const, int const, int>::value is an integral constant expression that evaluates to false.

are_same<int&, int>::value is an integral constant expression that evaluates to false.

are_same<int&, int, int&>::value is an integral constant expression that evaluates to false.

are_same<O...>::value_type is the type bool.


PrevUpHomeNext