database: Ensure new write_type is correctly printed

By removing the default case in the switch statement over a write_type
variable, we ensure the compiler warns us about lack of exhaustiveness
in case we add a value to the enum but forget to change the
corresponding operator<<().

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
This commit is contained in:
Duarte Nunes
2017-01-16 17:52:18 +02:00
parent 365df8f900
commit 11bd3bd29f

View File

@@ -2985,16 +2985,14 @@ namespace db {
std::ostream& operator<<(std::ostream& os, const write_type& t) {
switch(t) {
case write_type::SIMPLE: os << "SIMPLE"; break;
case write_type::BATCH: os << "BATCH"; break;
case write_type::UNLOGGED_BATCH: os << "UNLOGGED_BATCH"; break;
case write_type::COUNTER: os << "COUNTER"; break;
case write_type::BATCH_LOG: os << "BATCH_LOG"; break;
case write_type::CAS: os << "CAS"; break;
default:
assert(false);
case write_type::SIMPLE: return os << "SIMPLE";
case write_type::BATCH: return os << "BATCH";
case write_type::UNLOGGED_BATCH: return os << "UNLOGGED_BATCH";
case write_type::COUNTER: return os << "COUNTER";
case write_type::BATCH_LOG: return os << "BATCH_LOG";
case write_type::CAS: return os << "CAS";
}
return os;
abort();
}
std::ostream& operator<<(std::ostream& os, db::consistency_level cl) {