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:
16
database.cc
16
database.cc
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user