Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-04-26 12:51:28

David Abrahams wrote:

>"Peter Dimov" <pdimov_at_[hidden]> writes:

>>> However, the situation is different there as the called function
>>> only accepts exactly one parameter.
>> It doesn't matter. ADL should find the overload, provided that
>> 'serialize'
>> is not qualified at the point of the call.
>> In my own library I use very similar read/write overloads that are,
>> indeed, placed in the namespace of the corresponding class and found by
>> ADL. Yes, it works with VC 7.1.

>The recommended "overload in the library namespace" procedure was a
>big concern for me, but I didn't post anything because I couldn't
>remember why it's an issue. I have in my mind, left over from my work
>with Peter on this problem, a rule that in the current language you
>shouldn't do that, and should rely instead on ADL. I don't know why
>I think that anymore, but I *can* say that Peter should be listened
>to in this area; he's more aware of the issues than almost anyone.

OK, I've looked at code and found that found that my calls to "serialize"
are qualified by boost::serialization. So this can be fixed. It seems that
users of older compilers will have to overload in the library namespace but
that it will not be necessary for users that are only concerned with newer
compilers. So its not a problem for the library.


What about when I've overloaded from with in the library - such as when
default serialization traits are overloaded. Should this namespace
specification be #ifdef/#endif depending on the compiler config? Should

Robert Ramey

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