|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-12 07:05:50
From: "Vladimir Prus" <ghost_at_[hidden]>
>
> > 2. describe left no place for const - a key point in correctness and
eliminating
> > redundance in diamond inhertitance situations.
>
> There's a proposed solution in another message (by Michel André), and
> it's not disproved yet.
The technique was interesting and probably warrants further research, but as
stated it's quite inflexible. When serializing you need to know which fields
are "attributes" and which are "composites" in order to call the proper
method. Some of the reasons that led me to the
template<class Reader, class Value> void read(Reader & r, Value & v);
format are that (1) the syntax is consistent for all objects, there are no
separate "attribute" and "composite" methods, and (2) the above exploits
Koenig lookup to find the proper "read" in either the Reader namespace or
the Value namespace, as different readers handle different types "natively",
without using/needing support from the Value (this also explains the static
polymorphism).
Operator<< works (I was using it too) but there is no way to pass an
additional "variable name" argument to it, hence the read/write named
functions.
Anyway, I don't want to stall the development by boasting about my library
since it's definitely not ready for prime time yet, which puts it in the
"vaporware" category as far as Boost is concerned. :-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk