Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2004-02-28 22:46:04


Paul Mensonides wrote:

>>-----Original Message-----
>>From: boost-bounces_at_[hidden]
>>[mailto:boost-bounces_at_[hidden]] On Behalf Of Thomas Witt
>
>
>>I do not get it. IIUC ADL does not apply to a qualified name. I.e.
>>std::min is just std::min and that's it.
>
>
> You have to do it to prevent macro expansion from a definition like this:
>
> #define min(x, y) ((x) < (y) ? (x) : (y))
>
> std::min(1, 2) // std::((1) < (2) ? (1) : (2))
> (std::min)(1, 2) // (std::min)(1, 2)
>
> Regards,
> Paul Mensonides

Thanks Paul. But I do understand the reason why we need to disable macro
expansion (at least I think so).

I was referring to the following sentence

           o Use boost::std_min(a,b) if you do require argument-dependent
             look-up. boost::std_min() delegates to std::min().

I can't see where ADL comes into play here.

Thomas


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk