You are viewing a single comment's thread. Return to all comments →
Simple work around because bad_alloc is unreachable:
try { if (A > 1073741823LL) { Server::compute(2, 1); throw bad_alloc(); } cout << Server::compute(A, B) << '\n'; } catch (bad_alloc &e) { cout << "Not enough memory\n"; } catch (exception &e) { cout << "Exception: " << e.what() << '\n'; } catch (...) { cout << "Other Exception\n"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Exceptional Server
You are viewing a single comment's thread. Return to all comments →
Simple work around because bad_alloc is unreachable: