Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] polymorphic portablebinaryexamplenot working.
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2010-03-15 15:56:28


>> Because there's no polymorphic_text_oarchive.cpp
>> counterpart,
>
> I think this is in the src directory. It should be pre-compiled into the
> library so you never actually see it. The portable binary archive is
> an example, so it's not included in the library.
>

There is no polymorphic_text_oarchive.cpp or polymorphic_text_iarchive.cpp
in the boost 1.42 source. A search in the source for
"polymorphic*archive.cpp" only reveals:

./libs/serialization/example/polymorphic_portable_binary_iarchive.cpp
./libs/serialization/example/polymorphic_portable_binary_oarchive.cpp
./libs/serialization/src/polymorphic_iarchive.cpp
./libs/serialization/src/polymorphic_oarchive.cpp

And the latter 2 files basically only have these explicitly instantiations:

template class archive_serializer_map<polymorphic_iarchive>;
template class archive_serializer_map<polymorphic_oarchive>;

Which I don't believe should be replicated in
polymorphic_portable_binary_iarchive.cpp or
polymorphic_portable_binary_oarchive.cpp since in the boost source code
there is no explicit instantiations of the following forms:

template archive_serializer_map<polymorphic_text_iarchive>
template archive_serializer_map<polymorphic_text_oarchive>
...
etc.

BTW, why are you using explicit instantiations with seperate template .cpp
files? It becomes a management nightmare keeping track of what needs to
be explicitly instantiated in large projects. They're templates, so why
not just have everything in headers? An additional advantage being that
code is only generated for code that's used (implicitly instantiated) by
the client.

-Mostafa


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net