Although scoped enumerations (enum class) cannot be implicitly converted to integral types, I still can compare them by < (on GCC 10.3).
#include <algorithm>
#include <iostream>
enum class Colours {
Red = 0,
Green = 1,
Blue = 2
};
int main() {
std::cout << (std::min(Colours::Blue, Colours::Red) < Colours::Green) << std::endl;
return 0;
}
Why is this standard behaviour (if it is)?
Could you give me a reference to cppreference.com or c++ standard?