
Hi, gurus, If boost iterators are passed to 'std::equal' of VC++7.1, the 'std::equal' calls 'non-qualified' 'mismatch' and the unintentional ADLookup to 'namespace boost' finds incorrectly 'boost::mismatch' of range_ex. error C2039: 'const_iterator' : is not a member of 'boost::counting_iterator<Incrementable>' // He views iterator as range. #include <algorithm> #include <vector> #include <boost/iterator/counting_iterator.hpp> #include <boost/range_ex/algorithm.hpp> // greetings. int main() { std::vector<int> vec; std::equal(boost::counting_iterator<int>(0), boost::counting_iterator<int>(10), vec.begin()); return 0; } The workaround is something like: namespace boost_range_ex_unspecified { // many range algorithms here // ... } namespace boost { using namespace boost_range_ex_unspecified; } Regards, MB http://p-stade.sourceforge.net/ -------------------------------------- STOP HIV/AIDS. Yahoo! JAPAN Redribbon Campaign 2005 http://pr.mail.yahoo.co.jp/redribbon/

MB wrote:
If boost iterators are passed to 'std::equal' of VC++7.1, the 'std::equal' calls 'non-qualified' 'mismatch' and the unintentional ADLookup to 'namespace boost' finds incorrectly 'boost::mismatch' of range_ex.
...
The workaround is something like:
namespace boost_range_ex_unspecified { // many range algorithms here // ... }
namespace boost { using namespace boost_range_ex_unspecified; }
Oops, you're right. Ahh, fun with ADL. Thanks for the report. -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (2)
-
Eric Niebler
-
MB