Boost logo

Boost :

From: Vyacheslav E. Andrejev (vandrejev_at_[hidden])
Date: 2004-11-18 02:04:41

Hello Peter,
PD> Vyacheslav E. Andrejev wrote:
>>> I concluded that the issue with the serialization library was a
>>> valid one - although it didn't show up in any testing, and removed
>>> some leftover useless code.
>> Sorry, but your removal didn't fully eliminate the problem. In large
>> enough project the problem comes up eventually.
>>> Another suggestion was to define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
>>> for VC 7.1 .
>>> a) I didn't feel sufficiently knowledgable to evaluate such a
>>> proposal.
>>> b) It seemed (and still seems) pretty radical to me.
>>> c) Such a change would have to be made only after thorough
>>> investigation of
>>> any vagarities in VC 7.1 implementation of ADL. I suspect that no
>>> one has
>>> been able to justify this effort.
>>> Robert Ramey
>> Yes, your're right. But this preprocessor macro is used only in one
>> place of the whole boost, namely in serialization library.
PD> Out of curiosity, what ADL-related problems are you experiencing
PD> with VC 7.1? I'm not aware of any. Templated inline friends
PD> sometimes confuse the code generator, but this doesn't seem to be
PD> the issue here.
boost::serialization has load and save template functions defined in std namespace for serialization of std collections. These functions are specialized for every std collection and are called from serialization namespace. Sometimes (by very curious conditions) vc7.1 compiler injects into object code calls to them just like they are in serialization namespace (i.e. ADL fails), consequently linker generates error that it can not find serialization::load or/and serialization::save. This problem was reported by me in boost.devel 09.11.2004 (Message-ID: <cmq7ir$64n$1_at_[hidden]>) and by Delfin Rojas in boost.user 10.11.2004 (Message-ID: <200411101619.iAAGJnji009552_at_[hidden]>). Problem appears in very subtle hardly reproducible conditions. For example, in my project it appeared when I add additional insert to set collection. Something like this
set<my_type> p1, p2;
p2.insert(my_type()); // without this line all works fine
Note, that in the rest of code this set never had been serialized at all, even set<my_type> didn't, actually list<my_type> is that suffered serialization. Further experiments with code led to the compiler internal error.
Since I was limited in time, I simply edit serialization library to put load and save by force into serialization namespace. After this everything became ok.
>From this I supposed that ADL in vc7.1 unstable because of some internal compiler errors.

Vyacheslav E. Andrejev
System Architect, Excelsior, LLC

Boost list run by bdawes at, gregod at, cpdaniel at, john at