Open
Description
C++11 introduces enum classes which are not implicitly convertible to integers. This stops the standard CHECK_EQUAL etc macros from working.
To fix this you then have to write a streaming operator
std::ostream& operator<<(std::ostream& os, const EnumeratedType& val)
{
os << static_cast<std::underlying_type::type>(val);
return os;
}
or cast to an int in the macro.
CHECK_EQUAL((int)EnumeratedType::OK, (int)actual);
This gets old pretty fast. Is there a possibility of writing some clever template trickery to support enum classes? It could be selectively enabled by detection of c++11.
std::enable_if, std::is_enum look like good starting points.