Hi fellow c++ users. I'm puzzled why the following doesn't compile. I define
a smaller than operator (<) on complex<double> and use it in a pair. But it doesn't compile saying there is no matching <. Using my own bogus complex class it does compile. Can someone help me?
#include <cstdio>
#include <utility>
#if 1 // change to 0, to use my bogus complex class which does compile
#include <complex>
#else
template<typename T>
class complex {
T x, y;
public:
complex(T _x, T _y):x(_x), y(_y) {}
T real() const {return x;}
T imag() const {return y;}
};