With C++ scoped enums, I have to write, for example:
enum class matrix_type_t { BINARY, INTEGER, REAL, COMPLEX };
std::string matrix_type_str(matrix_type_t type) {
switch (type) {
case matrix_type_t::BINARY:
return std::string("binary");
case matrix_type_t::INTEGER:
...
}
}
However, if the context is clear, I would prefer:
std::string matrix_type_str(matrix_type_t type) {
??? // e.g. something as: using matrix_type_t::;
switch (type) {
case BINARY:
return std::string("binary");
case INTEGER:
...
}
}
Is this possible to achieve somehow? If not, wouldn't it be worth considering for future C++?