|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-03-23 08:00:50
Dave Gomboc <dave_at_[hidden]> writes:
>>>>Yes. Since type_info objects can't be copied, one might instead store
>>>>pointers or references to them.
>>>
>>> Pointers would be better because, for better or for worse (mostly for
>>> worse), standard exceptions support assignment as part of their
>>> interface.
>>
>>Why should boost exception classes behave like std:: exception
>>classes in this regard?
>
> Since you advocate elsewhere that exception classes be derived from
> std::exception, the answer is because otherwise LSP would be violated.
You can't access the derived class' assignment operator through a
pointer/reference to a polymorphic base, so that point is moot.
LSP is weird anyway. What's the point of polymorphism if you're not
going to change the behavior of the class in some observable way? If
the derived class were transparently substitutable for the base class
it wouldn't be much good, would it?
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk