@@ -149,17 +149,17 @@ class parse_error : public exception
149149 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
150150 static parse_error create (int id_, const position_t & pos, const std::string& what_arg, BasicJsonContext context)
151151 {
152- std::string w = concat (exception::name (" parse_error" , id_), " parse error" ,
153- position_string (pos), " : " , exception::diagnostics (context), what_arg);
152+ const std::string w = concat (exception::name (" parse_error" , id_), " parse error" ,
153+ position_string (pos), " : " , exception::diagnostics (context), what_arg);
154154 return {id_, pos.chars_read_total , w.c_str ()};
155155 }
156156
157157 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
158158 static parse_error create (int id_, std::size_t byte_, const std::string& what_arg, BasicJsonContext context)
159159 {
160- std::string w = concat (exception::name (" parse_error" , id_), " parse error" ,
161- (byte_ != 0 ? (concat (" at byte " , std::to_string (byte_))) : " " ),
162- " : " , exception::diagnostics (context), what_arg);
160+ const std::string w = concat (exception::name (" parse_error" , id_), " parse error" ,
161+ (byte_ != 0 ? (concat (" at byte " , std::to_string (byte_))) : " " ),
162+ " : " , exception::diagnostics (context), what_arg);
163163 return {id_, byte_, w.c_str ()};
164164 }
165165
@@ -193,7 +193,7 @@ class invalid_iterator : public exception
193193 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
194194 static invalid_iterator create (int id_, const std::string& what_arg, BasicJsonContext context)
195195 {
196- std::string w = concat (exception::name (" invalid_iterator" , id_), exception::diagnostics (context), what_arg);
196+ const std::string w = concat (exception::name (" invalid_iterator" , id_), exception::diagnostics (context), what_arg);
197197 return {id_, w.c_str ()};
198198 }
199199
@@ -211,7 +211,7 @@ class type_error : public exception
211211 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
212212 static type_error create (int id_, const std::string& what_arg, BasicJsonContext context)
213213 {
214- std::string w = concat (exception::name (" type_error" , id_), exception::diagnostics (context), what_arg);
214+ const std::string w = concat (exception::name (" type_error" , id_), exception::diagnostics (context), what_arg);
215215 return {id_, w.c_str ()};
216216 }
217217
@@ -228,7 +228,7 @@ class out_of_range : public exception
228228 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
229229 static out_of_range create (int id_, const std::string& what_arg, BasicJsonContext context)
230230 {
231- std::string w = concat (exception::name (" out_of_range" , id_), exception::diagnostics (context), what_arg);
231+ const std::string w = concat (exception::name (" out_of_range" , id_), exception::diagnostics (context), what_arg);
232232 return {id_, w.c_str ()};
233233 }
234234
@@ -245,7 +245,7 @@ class other_error : public exception
245245 template <typename BasicJsonContext, enable_if_t <is_basic_json_context<BasicJsonContext>::value, int > = 0 >
246246 static other_error create (int id_, const std::string& what_arg, BasicJsonContext context)
247247 {
248- std::string w = concat (exception::name (" other_error" , id_), exception::diagnostics (context), what_arg);
248+ const std::string w = concat (exception::name (" other_error" , id_), exception::diagnostics (context), what_arg);
249249 return {id_, w.c_str ()};
250250 }
251251
0 commit comments