std::is_same (3) - Linux Manuals
std::is_same: std::is_same
NAME
Synopsis
Defined in header <type_traits>
template< class T, class U > (since C++11)
struct is_same;
If T and U name the same type (including const/volatile qualifications), provides the member constant value equal to true. Otherwise value is false.
Commutativity is satisfied, i.e. for any two types T and U, is_same<T, U>::value == true if and only if is_same<U, T>::value == true.
Helper variable template
template< class T, class U > (since C++17)
inline constexpr bool is_same_v = is_same<T, U>::value;
Inherited from std::integral_constant
Member constants
value true if T and U is the same type , false otherwise
[static]
Member functions
operator bool (public member function)
operator() returns value
(C++14)
Member types
Type Definition
value_type bool
type std::integral_constant<bool, value>
Possible implementation
Example
// Run this code
Possible output:
See also
is_integral checks if a type is an integral type
(C++11)
make_signed makes the given integral type signed
(C++11)
make_unsigned makes the given integral type unsigned
(C++11)