|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2003-04-21 11:14:04
Vladimir Prus wrote:
>That's interesting. I wonder if 'const-correctness', here, is just a
>theoretical question, or can cause real problems. For example (using
>describe-based scheme):
> class C {
> public:
> C() ...
> template<class D>
// "const" here advertises that invocation of the function won't change the state
// of the instance. This isn't true for loading.
> void describe(D& d) const {
> d & m_i;
> }
// My assumption has been that "const int m_i" can only be at object creation time.
// Situations such as this motivated me to permit non-default constructors
// submitted system. Now I wonder. In any case I prefer to minimize const casting
// at least at the user level.
> const int m_i;
> };
with alternate save load the save can be const while the load isn't. Thats the best
from a const- point of few.
>a.store_polymorphic_pointer_with_known_type<Update_event>(&ev);
This is supported in the reviewed version. The requirement for forward declaration
of derived classes will be lifted. I believe that would address your case.
Robert Ramey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk