I have such problem:
this piece of code causes compile error. Could anyone tell me why and how can I avoid this error (I've compiled it using VC6 without errors and warnings):
Code: Select all
#include <vector>
#include <algorithm>
class CHAIN
{
public:
int a,b,c;
int operator<(const CHAIN &s)
{
/* doing something, never mind what ;-) */
return 1;
}
};
typedef std::vector<CHAIN> ChainVector;
using namespace std;
int main(void)
{
ChainVector v;
v.resize(0);
/* read data into vector */
...
sort(v.begin(),v.end()); // <- this line causes error, see below
...
return 0;
}

Best regards
DM