Path: csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 15 Mar 2016 08:50:07 -0500 Return-Path: Sender: lang-cpp-request@vandevoorde.com Approved: c.l.c.m@bazarov.com Message-ID: <87d1qy5aab.fsf@gmail.com> Newsgroups: comp.lang.c++,comp.lang.c++.moderated From: Gareth Owen Subject: Re: C++ exceptions are broken. Organization: unknown References: <20160308184714.bdb1e8f73fd1db86e9c83dc9@speakeasy.net> <20160313124838.377cf0fcbce06a95bb9167ff@speakeasy.net> Content-Type: text/plain X-Original-Date: Sun, 13 Mar 2016 21:37:48 +0000 X-Submission-Address: lang-cpp-submit@vandevoorde.com Date: Tue, 15 Mar 2016 08:45:17 CST Lines: 21 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-N0a3RWI9W//aeud6s6fuU11rNWvMtgmJv97dJPc8N5tgN6vD6rOwG4IXyCGh7FFzxFFqxQ1HaVr0A9r!Kw+Aw9KAKksZ55CrqLFPAjqD8edZWNDWlScGsGf9h7OTJ+mz X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1878 Xref: csiph.com comp.lang.c++:41525 comp.lang.c++.moderated:7407 "James K. Lowden" writes: > Oh, so you mean that the programmer may do something in handling the > exception to convert logic_error to runtime_error. Sure. No, the problem is throw std::logic_error("I've made a terrible mistake"); calls the constructor std::logic_error(const std::string&); which has to construct a string, which might throw std::bad_alloc -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]