
From intrusive_ptr.html: <quote> Every new intrusive_ptr instance increments the reference count by using an unqualified call to the function intrusive_ptr_add_ref, passing it the
Hi there pointer as an argument. Similarly, when an intrusive_ptr is destroyed, it calls intrusive_ptr_release; this function is responsible for destroying the object when its reference count drops to zero. The user is expected to provide suitable definitions of these two functions. On compilers that support argument-dependent lookup, intrusive_ptr_add_ref and intrusive_ptr_release should be defined in the namespace that corresponds to their parameter; otherwise, the definitions need to go in namespace boost. </quote> It's the last 8 words that don't make much sense to me. That would force some libraries using intrusive_ptr to make using declarations or directives in headers. IMHO there's no other choice but to put the two functions in the global namespace for compilers that do not support ADL. What am I missing? Thanks & Regards, Andreas

Andreas Huber wrote:
Hi there
From intrusive_ptr.html: <quote> Every new intrusive_ptr instance increments the reference count by using an unqualified call to the function intrusive_ptr_add_ref, passing it the pointer as an argument. Similarly, when an intrusive_ptr is destroyed, it calls intrusive_ptr_release; this function is responsible for destroying the object when its reference count drops to zero. The user is expected to provide suitable definitions of these two functions. On compilers that support argument-dependent lookup, intrusive_ptr_add_ref and intrusive_ptr_release should be defined in the namespace that corresponds to their parameter; otherwise, the definitions need to go in namespace boost. </quote>
It's the last 8 words that don't make much sense to me. That would force some libraries using intrusive_ptr to make using declarations or directives in headers.
Why would it do that?
IMHO there's no other choice but to put the two functions in the global namespace for compilers that do not support ADL. What am I missing?
The global namespace can only work if there are no shadowing declarations in namespace boost.

"Peter Dimov" <pdimov@mmltd.net> wrote in message news:01ae01c423a5$2ae2f730$1d00a8c0@pdimov2...
Andreas Huber wrote: [snip]
It's the last 8 words that don't make much sense to me. That would force some libraries using intrusive_ptr to make using declarations or directives in headers.
Why would it do that?
Yeah, a very good question. I just realised that some of my assumptions about (non-ADL) lookup were incorrect. Thanks & Regards, Andreas
participants (2)
-
Andreas Huber
-
Peter Dimov