|
Boost : |
From: Ken MacKay (kmackay_at_[hidden])
Date: 2006-06-20 12:55:52
Peter Dimov wrote:
> Ken MacKay wrote:
>> I found that I can use bind without specifying the boost namespace
>> when a placeholder (eg, _1) is used. If I don't use a placeholder in
>> the bind expression, then the compiler properly complains that "bind"
>> is undeclared. I am using gcc 3.3.5 on QNX 6.3.2.
>
> This behavior is caused by a C++ rule known as argument-dependent
> lookup (ADL) or Koenig lookup. In an expression of the form f(x,
> y), f is (also) looked up in the ("associated") namespaces of x and
> y. Since _1 is usually of type boost::arg<1>, boost is an
> associated namespace for it and the function "bind" is found
> without an explicit boost:: qualification.
OK, that makes sense. Thank you Peter.
-Ken
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk