Topic: restrictions on exception handling in basic_stringbug::overflow()
Author: Dietmar Kuehl <dietmar.kuehl@claas-solutions.de>
Date: 1999/10/27 Raw View
Hi,
In article <hpk8oh263k.fsf@shell.faradic.net>,
Matt McClure <matthew.mcclure.es.99@aya.yale.edu> wrote:
> The standard 27.7.1.2 specifies that basic_stringbuf::overflow()
> should
> return traits::eof() to indicate failure. Does this imply that it
> should not throw any exceptions even though it does not have an
> exception specification?
No. Any standard library function may throw implementation defined
exceptions unless it is specified otherwise. An exception thrown from
the strings allocator is probably not caught.
--
<mailto:dietmar.kuehl@claas-solutions.de>
homepage: <http://www.informatik.uni-konstanz.de/~kuehl>
Sent via Deja.com http://www.deja.com/
Before you buy.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Matt McClure <matthew.mcclure.es.99@aya.yale.edu>
Date: 1999/10/21 Raw View
The standard 27.7.1.2 specifies that basic_stringbuf::overflow() should
return traits::eof() to indicate failure. Does this imply that it
should not throw any exceptions even though it does not have an
exception specification? For example, suppose overflow() called new()
which threw bad_alloc. Should overflow() catch and handle it by
returning traits::eof() instead of rethrowing the exception?
--
--------------------------------------
| matthew.mcclure.es.99@aya.yale.edu |
| http://www.faradic.net/~mmcclure |
--------------------------------------
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]