How is T(2) == T(1) different from std::is_same_v<T, bool> for integral type T?

Advertisements I would like to ensure that an integral type is not bool in static_assert. I found in the source code of libstdc++ that it uses _Mn(2) != _Mn(1) for this purpose: template<typename _Mn, typename _Nn> constexpr common_type_t<_Mn, _Nn> gcd(_Mn __m, _Nn __n) noexcept { static_assert(is_integral_v<_Mn>, "std::gcd arguments must be integers"); static_assert(is_integral_v<_Nn>, "std::gcd arguments must… Read More How is T(2) == T(1) different from std::is_same_v<T, bool> for integral type T?