Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-27 10:44:55


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

> Vladimir Prus wrote:
>>
>> Does serialization library (exception for *SPLIT* macros), ever
>> calls 'load' function that is provided by the user.
>>
>> Your explanation above only reiterates what I've said: the
>> serialization library only calls the "serialize" function. That
>> function might delegate
>> its work to the 'load' function, but it happens inside user code, not
>> inside serialization code. That's why I think you should prevent ADL
>> when calling 'load' in the mentioned place.
>
> To be honest, I would have to go back and review a little to give you a
> definitive answer. But the only member function called by the library is
> "serialize". I think the issue comes up regarding the usage of the free
> function template "serialize". If one uses "split_free" then there one
> needs load and save functions and the question arises as to which namespaces
> they should be in. I prefered putting them boost::serialization:: . If I
> remember correctly, I then had a problem with compilers that use two-phase
> lookup and I hade to permit ADL so that the templates would be checked again
> at instantiation time.

That's not the best way to fix the problem. Just make sure the
functions are declared before use and they will be found with explicit
qualification.

-- 
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