I am getting error while using map.
#include <bits/stdc++.h>
using namespace std;
class Vertex
{
public:
int x,y;
Vertex(int x,int y) : x(x), y(y) {}
};
class cmp {
public:
bool operator()(const Vertex &a, const Vertex &b)
{
return a.x < b.x;
}
};
int main() {
map<Vertex, Vertex, cmp> mp;
Vertex u(0,0);
Vertex v(1,2);
mp[u] = v;//This line gives error
return 0;
}
what is wrong with mp[u]=v?