How to check if two types are same at compiletime(bonus points if it works with Boost strong typedef)
问题 I was wondering if it is possible to check if 2 types are same at compile time. What I came up with is(idk if it works because it feels hackish and IDK standard that good so IDK what to look for when testing). #include <boost/strong_typedef.hpp> BOOST_STRONG_TYPEDEF(double, cm); BOOST_STRONG_TYPEDEF(double, inch); template<typename T, typename U> static constexpr void __help() { } template<typename T, typename U> class AreSameType { public: constexpr operator bool() { return &__help<T,U> == &