[Boost-bugs] [Boost C++ Libraries] #6715: Derived from iterator_range and operator==

Subject: [Boost-bugs] [Boost C++ Libraries] #6715: Derived from iterator_range and operator==
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-20 14:09:23

#6715: Derived from iterator_range and operator==
 Reporter: Olaf van der Spek <olafvdspek@…> | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: |
 Shouldn't this just work?
 Comparing two boost::iterator_range<const char*> works fine.

 #include <boost/range/iterator_range.hpp>

 class str_ref : public boost::iterator_range<const char*>

 int main()
        boost::iterator_range<const char*> a;
        a == a;
        str_ref b;
        b == b; // 12

 is.cpp: In function ‘int main()’:
 is.cpp:12:7: error: ambiguous overload for ‘operator==’ in ‘b == b’
 is.cpp:12:7: note: candidates are:
 is.cpp:12:7: note: operator==(boost::iterator_range<const
 char*>::unspecified_bool_type {aka const char*
 boost::iterator_range<const char*>::*}, boost::iterator_range<const
 char*>::unspecified_bool_type {aka const char*
 boost::iterator_range<const char*>::*}) <built-in>
 /usr/include/boost/range/iterator_range_core.hpp:438:21: note: bool
 boost::operator==(const boost::iterator_range<IteratorT>&, const
 ForwardRange&) [with IteratorT = const char*, ForwardRange = str_ref]
 /usr/include/boost/range/iterator_range_core.hpp:431:21: note: bool
 boost::operator==(const boost::iterator_range<IteratorT>&, const
 boost::iterator_range<Iterator2T>&) [with Iterator1T = const char*,
 Iterator2T = const char*]
 /usr/include/boost/range/iterator_range_core.hpp:387:21: note: bool
 boost::operator==(const ForwardRange&, const
 boost::iterator_range<IteratorT>&) [with IteratorT = const char*,
 ForwardRange = str_ref]

Ticket URL: <https://svn.boost.org/trac/boost/ticket/6715>
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:09 UTC