I installed the Digital Mars C/C++ compiler on Windows. This is the full paid version that include pre-built STLPort) It's dm852.zip, but dmc reports 8.42n. STLPort says version 4.5.3 in the readme.
As required to use STLPort, I updated sc.ini to have:
INCLUDE="%@P%..\stlport\stlport";"%@P%..\include";%INCLUDE%
The following test program compiles fine with MinGW g++ but with dmc gives the errors shown in the comments.
#include <assert.h>
#include <utility>
using namespace std;
using namespace std::rel_ops;
class C {
int x;
public:
C(int x_) : x(x_)
{ }
bool operator<(const C& other) const
{ return x < other.x; }
bool operator==(const C& other) const
{ return x == other.x; }
};
int main() {
C a(1);
C b(1);
C c(2);
assert(a == b);
assert(b != c); // Error: illegal operand types Had: C and C
assert(a < c);
assert(c > a); // Error: illegal operand types Had: C and C
return 0;
}
I can find the actual relops code in dm/stl/stl_relops.h
But I'm not sure how this code is supposed to get included by dm/stlport/stlport/utility
The Digital Mars version of STLPort appears to be configured to not use the rel_ops namespace (#define _STLP_NO_RELOPS_NAMESPACE in dm/stlport/stlport/config/stl_dm.h) but omitting "using namespace std::rel_ops" didn't help.
It seems like this must be some kind of configuration issue but I haven't been able to figure it out.