We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92e48c0 commit 7d11078Copy full SHA for 7d11078
1 file changed
leetcode/parser.hpp
@@ -276,19 +276,15 @@ void run(R (Solution::*fn)(Ts...)) {
276
return;
277
}
278
279
- try {
280
- if constexpr (same_as<R, void>) {
281
- apply(fn, args);
282
- []<size_t... Idx>(auto &&args, index_sequence<Idx...>) {
283
- ((cout << "#" << (Idx + 1) << ": ",
284
- print_impl(cout, get<Idx + 1>(args), true)),
285
- ...);
286
- }(args, index_sequence_for<Ts...>{});
287
- } else {
288
- auto res = apply(fn, args);
289
- print_impl(cout, res, true);
290
- }
291
- } catch (const exception &e) {
292
- cerr << "Runtime error: " << e.what() << endl;
+ if constexpr (same_as<R, void>) {
+ apply(fn, args);
+ []<size_t... Idx>(auto &&args, index_sequence<Idx...>) {
+ ((cout << "#" << (Idx + 1) << ": ",
+ print_impl(cout, get<Idx + 1>(args), true)),
+ ...);
+ }(args, index_sequence_for<Ts...>{});
+ } else {
+ auto res = apply(fn, args);
+ print_impl(cout, res, true);
293
294
0 commit comments