Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.lang.c++ > #41527
| Newsgroups | comp.lang.c++ |
|---|---|
| Date | 2016-03-15 11:28 -0700 |
| References | (1 earlier) <20160308184714.bdb1e8f73fd1db86e9c83dc9@speakeasy.net> <NN-dnVoIWp4b-XnLnZ2dnUU7-WVj4p2d@giganews.com> <20160313124838.377cf0fcbce06a95bb9167ff@speakeasy.net> <87d1qy5aab.fsf@gmail.com> <dkqq5hFau71U1@mid.individual.net> |
| Message-ID | <4df8ef1e-3b67-4b2b-8a59-a8a09d5aeed6@googlegroups.com> (permalink) |
| Subject | Re: C++ exceptions are broken. |
| From | woodbrian77@gmail.com |
On Tuesday, March 15, 2016 at 12:30:17 PM UTC-5, Bo Persson wrote:
> On 2016-03-15 15:45, Gareth Owen wrote:
> >
> > 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
> >
> >
>
> There is also a constructor
>
> explicit logic_error(const char*);
>
> which doesn't have to call a string constructor.
>
>
>
> Bo Persson
>
What's the point of std::logic_error? Asserting has
already been defended and I agree with those who say to
use asserts. Recent threads, including this one, have
pointed out dangers and snares associated with
std::logic_error. IMO C++ would be better off without it.
Brian
Ebenezer Enterprises
http://webEbenezer.net
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar
C++ exceptions are broken. Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-03-08 06:31 -0600
Re: C++ exceptions are broken. woodbrian77@gmail.com - 2016-03-08 07:10 -0800
Re: C++ exceptions are broken. scott@slp53.sl.home (Scott Lurndal) - 2016-03-08 17:26 +0000
Re: C++ exceptions are broken. "James K. Lowden" <jklowden@speakeasy.net> - 2016-03-09 08:25 -0600
Re: C++ exceptions are broken. Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-03-12 19:11 +0000
Re: C++ exceptions are broken. Öö Tiib <ootiib@hot.ee> - 2016-03-12 15:05 -0800
Re: C++ exceptions are broken. Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-03-12 14:46 -0600
Re: C++ exceptions are broken. Hergen Lehmann <hlehmann.expires.5-11@snafu.de> - 2016-03-12 16:50 -0600
Re: C++ exceptions are broken. "James K. Lowden" <jklowden@speakeasy.net> - 2016-03-13 15:55 -0600
Re: C++ exceptions are broken. Gareth Owen <gwowen@googlemail.com> - 2016-03-15 08:45 -0600
Re: C++ exceptions are broken. Bo Persson <bop@gmb.dk> - 2016-03-15 12:22 -0600
Re: C++ exceptions are broken. woodbrian77@gmail.com - 2016-03-15 11:28 -0700
Re: C++ exceptions are broken. "Alf P. Steinbach" <alf.p.steinbach+usenet@googlemail.com> - 2016-03-17 06:43 -0600
Re: C++ exceptions are broken. Paavo Helde <myfirstname@osa.pri.ee> - 2016-03-17 06:43 -0600
Re: C++ exceptions are broken. Gareth Owen <gwowen@googlemail.com> - 2016-03-15 08:44 -0600
csiph-web