Skip to content

Commit

Permalink
Refactor helper code for enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
roastduck committed Jan 19, 2024
1 parent baab930 commit a6a2a5d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/type/data_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,8 @@ inline SignDataType parseSignDataType(const std::string &str) {
return (SignDataType)i;
}
}
std::string msg =
"Unrecognized sign data type \"" + str + "\". Candidates are: ";
for (auto &&[i, s] : views::enumerate(signDataTypeNames)) {
msg += (i > 0 ? ", " : "");
msg += s;
}
ERROR(msg);
ERROR(FT_MSG << "Unrecognized sign data type \"" << str
<< "\". Candidates are: " << (signDataTypeNames | join(", ")));
}

class DataType {
Expand Down

0 comments on commit a6a2a5d

Please sign in to comment.