https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83607
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- No, because not all enumeration types behave like the integers: enum E : unsigned char { }; namespace std { template<> struct equal_to<E> { bool operator()(E l, E r) const noexcept { return ((unsigned)l % 16) == ((unsigned)r % 16); } }; }