Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if two types are equal in C++

Tags:

People also ask

How do you know if types are equal?

Equals() Method is used to check whether the underlying system type of the current Type is the same as the underlying system type of the specified Object or Type.

How do you check if something is equal to in C?

Checking for equality in C and C++identifier == identifier; The == sign is used to compare primitive types such as char, int, float, etc. The comparison operator returns true if the two identifiers are equal.


How to check if types are equal in C++11?

 std::uint32_t == unsigned;  //#1 

And another snippet

template<typename T> struct A{    string s = T==unsigned ? "unsigned" : "other"; }