[Boost-bugs] [Boost C++ Libraries] #6357: Resolve ambiguity for unqualified call to begin/end

Subject: [Boost-bugs] [Boost C++ Libraries] #6357: Resolve ambiguity for unqualified call to begin/end
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-04 14:58:38


#6357: Resolve ambiguity for unqualified call to begin/end
------------------------------+---------------------------------------------
 Reporter: theller | Owner: theller
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: phoenix
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 On 12/16/2011 10:44 AM, Nathan Ridge wrote:
>
> Hello,
>
> I am running into a problem where an unqualified call to begin()
> on a range type whose template parameters include a Boost.Phoenix
> type (for examle filtered_range<Pred, R> where Pred is a phoenix
> function) is ambiguous because, in addition to the intended
> std::begin, phoenix::begin is being found by ADL.
>
> What can be done about this? There exists precedent for placing
> boost::xxx::begin/end functions in ADL barrier namespaces because
> C++11 encourages unqualified calls to begin/end (specifically,
> this was done for boost::range::begin/end). Should the same thing
> be done for Phoenix?
>
> Here is a minimal example that reproduces the problem:

 {{{
 #include<iterator>

 #include<boost/range/adaptor/filtered.hpp>
 #include<boost/phoenix/phoenix.hpp>

 using std::begin;

 {{{
 int main()
 {
      using boost::phoenix::arg_names::arg1;
      using boost::adaptors::filtered;

      int v[5];
      const auto& f = v | filtered(arg1< 0);
      begin(f);
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6357>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC