Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-09-15 12:53:41


"Robert Ramey" <ramey_at_[hidden]> writes:

> I would call your attention to the code in serialization.hpp - line 108
> "layer 3". I believe that this code actually considered this problem. By
> using an argument from the boost::serialzation namespace It guarenteed that
> the correct overload would be found on the second phase of two phase lookup
> on compilers supporting ADL (all those that implement two-phase lookup). If
> I remember correctly, I also studied the rules that governed the conversion
> from boost::serialization::version_type to const unsigned integer and this
> information was used to make the process work. I left the note you see in
> the documentation. This resolved the compilation errors I was having with
> compilers which implement two-phase lookup so naturally I took this a
> confirmation that I understood the details. Unfortunately it was some time
> ago and and after I thought I resolved the problems generated by two-phase
> lookup I moved on to other problems. So I thought I understood it. Of
> course now I'm not so sure. I forgot the details of my solution but did
> remember the amount of detail I had to plow through.

Yikes!

**** I owe you an abject apology. I'm very sorry for wasting all ****
**** this time and energy. I should have looked at the code much ****
**** sooner. That's a very clever technique. ****

Provided the file_version parameter is never templatized, that trick
works and it's always okay to overload in boost::serialization.

>> It's hard for me to feel very sympathetic. You have the online
>> compiler.
>
> I don't think its practical to use the online compiler to compile code that
> requires scores of files.

I've done it. Just preprocess and paste.

>> You could find out what the switches are (--no-microsoft
>> and/or --no-microsoft-bugs) to turn on 2-phase lookup on your local
>> installation of comeau and do some experiments.
>
> I can and I will. I had no reason to suppose that it was turned off for
> boost (presumably in the toolset). I just assumed that build tools would be
> setup to maximize compiler conformance with the standard. Perhaps
> presumptuous on my part but I have to make some reasonable assumptions or
> I'll never get anything done.

The problem is that como still doesn't have a switch that turns off
MS bug compatibility but leaves on the extensions needed to compile MS
system headers. Without the ability to process Windows.h, many Boost
libraries wouldn't compile.

>> That would still be a big improvement on the status quo.
>
> OK I'll just make this alteration in that section. Halleluhuh

At this point, if you make any change I think you should add a note
for those of us who are too clever by half, saying that, yes, it's
really okay to overload in boost::serialization, and describing the
trick used.

So sorry,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk