From a6a2a5da9d3676dff8a86d7115b317c59caee2bf Mon Sep 17 00:00:00 2001 From: Shizhi Tang Date: Fri, 19 Jan 2024 17:24:07 +0800 Subject: [PATCH] Refactor helper code for enum types --- include/type/data_type.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/type/data_type.h b/include/type/data_type.h index c23a38ef6..74e368941 100644 --- a/include/type/data_type.h +++ b/include/type/data_type.h @@ -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 {