Jeroen T. Vermeulen wrote:
> On Wed, January 24, 2007 16:53, Bart Samwel wrote:
> 
>>>  I think
>>> multiple inheritance could really help by providing an additional
>>> taxonomy
>>> of errors besides this one.  At least it helps take away questions like
>>> "should this be a range_error *or* a libpqxx error?"
>> And maybe also questions like "should this be a logic_error or a
>> runtime_error?" :-)
> 
> That may be a bit harder...  :-/

Definitely. I checked, and this will actually not work at all. Since 
std::exception is not a virtual base class of std::logic_error or 
std::runtime_error, the base class std::exception will be ambiguous, and 
according to the C++ standard, item 15.3.3 (numbering of the TC2003 
version) only catch clauses for unambiguous public base classes qualtify 
as matches. This means that catch(const std::exception&) will not catch 
an exception object that is multiply inherited from logic_error and 
runtime_error. Bummer. :-)

Cheers,
Bart
_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to