|
Boost : |
Subject: [boost] [Range] Derived from iterator_range and operator==
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-03-16 11:46:25
Hi,
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]
-- Olaf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk