Boost logo

Boost Users :

Subject: Re: [Boost-users] [Lambda] Handling Bind/Lambda name clashes.
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-04-05 16:22:22


At Wed, 06 Apr 2011 02:41:45 +0700,
Eric Niebler wrote:
>
> On 4/5/2011 10:46 PM, Peter Dimov wrote:
> > Robert Jones wrote:
> >> > On Tue, Apr 5, 2011 at 2:27 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
> >> >
> >> > using boost::lambda::bind;
> >> >
> >> > should be a better choice.
> >>
> >> Hello Peter
> >>
> >> Yes, that was my first thought too. But this code still has ambiguity
> >> issues.
> >
> > Yes, you're right, it has. Since boost::function is in namespace boost,
> > the compiler still finds boost::bind via argument-dependent lookup.
>
> Yuk. Is it ever desirable for an argument of type boost::function to
> cause lookup in namespace boost? Probably not, right? That would argue
> for moving boost::function into an ADL-blocker namespace.
>
> And perhaps boost::bind and its placeholders should also be in an
> ADL-blocker namespace, but I seem to recall that the placeholders are
> not in any namespace for legacy reasons, is that right?

At this point, if such legacy compilers need to be supported, perhaps
it makes sense to put the placeholders in a namespace conditionally,
for all the other compilers?

I wonder if it would be a good idea to have a Boost-wide policy that
says something like,

  Librarry interfaces should not be compromised in any way for
  compilers shipped more than 10 years ago/not supported by their
  manufacturer/<appropriate other criterion here>

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net