This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

iterator ambiguates rel_ops operators



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?




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]