Well I am no expert in STL still can tell, you cannot initialize a pair like that. You have to either call its parameterized constructor or make_pair()
function template.
pair <int , int> p(1, 3); //constructor one
pair <int , int> p = make_pair(1, 3); // function template
Of course can do this.
#include <bits/stdc++.h>
using namespace std;
int main()
{
pair<int,int>p;
p = {1,3}; // This here is actually the overloaded assignment operator which is copying
}
Also you can not compare your pair with {1, 3} Use:
if(p == make_pair(1,3)) // this
if (p.first == 1 && p.second == 3) // or this
You should read documentation for if you want to know some internal structure because I am not much aware of it.