I want to create a pair in C++
int x=3;
int y =4;
std::pair<int,int> mypair = std::make_pair<int,int>(x,y);
But i get this error:
error: no matching function for call to ‘make_pair(int&, int&)’
std::pair<int,int> mypair = std::make_pair<int,int>(x,y);
On the other hand, if I use
std::pair<int,int> mypair = std::make_pair<int,int>(3,4);
then it works. Any explanation on ths? And how to make the first case above work so one can create a pair (x,y) wihtout pain?