|
Boost : |
From: MB (mb2act_at_[hidden])
Date: 2005-11-29 14:28:02
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/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk