|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-11 06:44:26
From: "Vladimir Prus" <ghost_at_[hidden]>
>
> I have tried hard to explain that while typeid would make archives
> unportable between different machines (not really an issue if there's
> denamgler for type_info::name() and I think work is underway on it),
An issue. You never know whether, or how, type_info::name() is mangled, or
whether there is type_info::name() at all (speaking of portable code.)
This (and the fact that given a type_info::name() you can't create an object
of this type) drives most people writing serializers nuts. :-)
The only portable C++-only solution (AFAIK) is to require registration of
all polymorphic types, including an identifier that uniquely describes the
type.
Not only that, but you also need to register derived to base conversions,
too, as I recently realized, since Derived * -> void * -> Base * is not
required to work.
> > There was quite a bit of discussion on the interface - particularly
regarding
> > the describe functionality. I had nothing against it in priniciple, its
just
> > that in practice it didn't really add anything.
>
> Except
> 1. It's much more terse
And much less const-correct.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk