Hi C++ experts,
In X86FloatingPoint.cpp there is a struct TableEntry that can be compared to an unsigned:
friend bool operator<(const TableEntry &TE, unsigned V) {
return TE.from < V;
}
This is used with std::lower_bound():
static int Lookup(const TableEntry *Table, unsigned N, unsigned Opcode) {
const TableEntry *I = std::lower_bound(Table, Table+N, Opcode);
...
}
It looks like the GNU libstdc++ is happy with the asymmetric types in the comparison, but MSVC insists that the transposed operator< also be available:
friend bool operator<(unsigned V, const TableEntry &TE) {
return V < TE.from;
}
It is not really clear from the draft C++0x standard what is required when the comparison function takes asymmetric types.
Is MSVC wrong here, and lower_bound should work with only one asymmetric comparison available?
Is it a bug in the standard that it isn't clearly specified?
/jakob
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev