This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
iterator ambiguates rel_ops operators
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: iterator ambiguates rel_ops operators
- From: Richard Andrews <richarda at ixla dot com dot au>
- Date: Thu, 18 Jan 2001 11:32:27 +1100
How can I use rel_ops and iterators together?
eg. try compiling this
#include <vector>
using std::rel_ops::operator!=;
class A
{
public:
bool operator==(const A & rhs ) const { return true; }
};
bool compare( const A & lhs,
const A & rhs )
{
return (lhs!=rhs );
}
bool compare( const std::vector<int>::iterator & lhs,
const std::vector<int>::iterator & rhs )
{
return (lhs!=rhs );
}
There is a template operator!=() for __normal_iterator<T_> which ambiguates the rel_ops operator!=() making it impossible to use rel_ops anywhere near iterators.
How can I get around this problem?
Is this a libstdc++ bug?