|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2002-11-11 23:40:44
>Date: Mon, 11 Nov 2002 20:08:26 +0300
>From: Vladimir Prus <ghost_at_[hidden]>
>> What is your evaluation of the design?
>First comes my opinion on library scope. The biggest features that it
>adds (compared with older 'describe' scheme) are saving of pointers and
>versioning.
Among other things also includes:
a) non-intrusive serialization
b) a systematic method of specifying serialization for templats
c) the above are used to include serialization of all STL collection templates
d) ability to specify particular archive format if the included ones don't suit
you
e) guaranteed archive portability between platforms
>Also, the natuaral syntax at the top of that section seems correct to me.
>If it is really not possible, then it should be told why.
Well, As I said in the documentation, the cited syntax seems correct to me
as well. I couldn't get it to compile in multiple environments. No one
has been able to explain it to me either. If anyone knows why, I will
add the expanation.
>
> What is your evaluation of the implementation?
>There's missing typename at
../../boost/serialization/stl.hpp:124
in my copy, line 124 is a blank
>And, BTW, is
>typeid of *t is not equal to static type of *t, then *t is
>already polymorphic, unless I'm missing something.
Its only polymorphic if it has at least one virtual function.
if it doesn't have at least one virtual function then dynamic_cast
fails for lack of a vtable.
>> What is your evaluation of the documentation?
>Documentation does not say that "version" must be *static* member
>function.
because it doesn't have to be a static member function. In can be
a member function or a virtual member function.
>Rationale section talks about "saved objects must be const". I don't
>understand what this means, and the example from reference for this
>part compiles fine for me, while docs say it should not.
hmmm - I'll refrase to "Save functions must be const"
Of course save objects don't have to be const, The save function
must specify const so the serialization process doesn't change them.
The following looks overly generic:
template<
class T,
class Allocator,
template Container<class T, class Allocator>
>
boost::basic_oarchive & ::operator<<(
boost::basic_oarchive & ar,
const Container<T, Allocator> & t
);
it would catch all classes which happen to be instances of templates with
two parameters. The phrase "STL containers can be serialized using above syntax"
is very confusing. I belive it should be stated that all STL containers can
be serialized, without the interface above.
> Did you try to use the library? With what compiler? Did you
> have any problems?
>Yes, with g++ 2.95.4 and 3.2 (although lack of Jamfile required manual compilation).
>It did not compile, saying that:
>./../boost/void_cast.hpp:28: redefinition of `struct boost::is_polymorphic<T>'
>/home/ghost/Work/boost/boost/type_traits/is_polymorphic.hpp:75: previous
> definition of `struct boost::is_polymorphic<T>'
>In file included from ../../boost/serialization/serialization_imp.hpp:16,
> from ../../boost/serialization/archive.hpp:4,
> from archive.cpp:17:
>./../boost/void_cast.hpp:28: redefinition of `struct boost::is_polymorphic<T>'
hmmm - my copy of boost_1_29_0 has no "is_polymorphic.hpp" in the type_traits
directory. I only downloaded this 10 days ago. Is there a 1_29_1 that I should
be using?
>I think the library should not be accepted. I don't like to vote this
>way, but I'm not convinced that serialization library with such requirement
>for storing polymorphic pointers is really ready to go.
Vladimir and I have has a spirted discussion on this issue for sometime.
I understand his desire, but, after much effort, I have been unable to
find any way to implement what he desires. Furthermore, I have come
to the conclusion that it is logically impossible to do so - see last
(unanswered) post.
http://aspn.activestate.com/ASPN/Mail/Message/1384779
http://aspn.activestate.com/ASPN/Mail/Message/boost/1428284
http://aspn.activestate.com/ASPN/Mail/Message/1357868
http://aspn.activestate.com/ASPN/Mail/Message/1355485
Robert Ramey
.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk