New issue
Advanced search Search tips

Issue 593705 link

Starred by 0 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Support CHECK_EQ for enum class

Project Member Reported by vabr@chromium.org, Mar 10 2016

Issue description

C++ enum class does not have operator<< defined.
Therefore CHECK_EQ(a, b) and similar macros won't work if a, b are enum class types.

(Note that the C-style enum works around this via the implicit conversion to int, which has operator<< defined.)

Should we build CHECK_EQ support for enum class types which do not have operator<< defined? Or is the way to go to define
std::ostream& operator<<(std::ostream& os, const T& e) {
  return os << static_cast<int>(e);
}
for every enum class type T separately?
 

Sign in to add a comment