Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-07-11 09:23:07

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
> Beman Dawes wrote:
>> <Oliver.Kowalke_at_[hidden]> wrote in message
>>> Hi,
>>> shouldn't system_error::const char * what() const contain throw ()?
>> Good question. I don't know the answer. The standard (for
>> std::exception, which is the eventual base class) says:
>> virtual const char* what() const throw();
>> system_error::what catches exceptions, so it never throws.
>> I afraid I still don't know the rule as to when you need to provide a
>> throw() specifier rather than just documenting that a function never
>> throws.
> You can't relax an exception specification in an overrider, only tighten
> it,
> so yes, system_error::what() needs throw(). I believe that a conforming
> compiler will reject it without the throw() specification.

Fixed. Thanks!


Boost list run by bdawes at, gregod at, cpdaniel at, john at