|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-09-14 16:35:25
David Abrahams wrote:
> The best thing you could do, IMO, is write a recommendation that
> works on conforming compilers, e.g.
>
> Overload serialize in the namespace of your class.
>
Oh, that's news to me. I thought that would work only in compilers that
implemented ADL. I understood from previous postings that this would entail
building a set a macros which addressed the varying aspect of conformity.
In 1.32 I had #if ... in order to place stl serializations in either the stl
namespace or the boost::serialization namespace depending on whether the
compiler supported ADL and two-phase lookup or neither of these things.
That was the only way I could get everything to compile on all platforms.
Then generated the requirement to address the issue in the documentation
with a table on what the user should use. That's what I call ugly.
FWIW - I'm not sure if the example you site would ever come up in practice -
it certainly hasn't yet. If I understand this correctly, the problem would
occur if someone writes somethng like:
my_class.hpp
class my_class ...
template<class Archive, my_class>
void serialize(Archive &ar, my_class & t, cont unsigned int version); //
declaration only
my_app.cpp
main(...
{
my_class mc;
...
ar & mc;
}
template<class Archive, my_class>
void serialize(Archive &ar, my_class & t, cont unsigned int version); //
definition only
I'm not absolutly sure that this is the only scenario which would create
problem and that's why I wanted more time to consider it.
If this is the only way the two-phase problem could manifest itself, I would
guess that in practice it would never be an issue. I don't see users doing
this. This was what I was getting at when I asked why the problem hasn't
appeared upto now. Of course I don't really know whether this is because so
many compilers fail to implement two-phase lookup.
>> b) I'm going to remove the class declaration and function
>> implementation from the Archive Concept part of the document.
> Are you planning to replace it with anything? It would be pretty
> silly to have a section called Archive Concept with no concept
> description.
I meant to leave in the text below the "class" schema. Before I started I
reviewed again the SGI documents and concluded that that text could be fit
into the SGI form for concepts. I'm using
http://www.sgi.com/tech/stl/Container.html as a "typical example". This
isn't hard - its basically a question of reformatting. I hope that will be
satisfactory.
>> The above I will check into RC_1_33_0
>>
>> Other issues that I intend to defer for the next version
>> d) investicate the two-phase lookup issue. There is no way any such
>> change could be made for RC_1_33_0 and the next boost release won't
>> be for another 10? months, so I feel that I can take some time with
>> this.
>
> That seems extreme to me. Surely for RC_1_33_0 a documentation fix
> that provides instructions that are both correct for conforming
> compilers and consistent with the current library implementation is
> possible? Not much more than a small tweak in emphasis would be
> required.
see above.
Robert Ramey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk