Boost logo

Boost :

Subject: Re: [boost] [intrusive_ptr] Why are comparison operators not friends?
From: Carsten Fuchs (carsten.fuchs_at_[hidden])
Date: 2012-08-10 04:25:53

Hi Christopher,

Am 2012-08-09 12:47, schrieb Hite, Christopher:
>> I was just (re-)reading item 46, "Define non-member functions inside templates when type conversions are desired", in Scott Meyers "Effective C++, 3rd edition", and was wondering how and why the comparison operators for intrusive_ptr work when used with NULL, even though they're > not friend functions as described in Scott Meyer's item 46.
> I believe you're talking about the ancient technique of friend injection used here for example:
> The modern good way of doing this Koenig lookup which I think deprecates that trick.

Thank you very much for your reply!

I still have to experiment and compare and check my code, but the linked articles and
their references help a lot!

Best regards,

    Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
           Learn more at

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