Maps and lcs

why in the following code the map is not getting passed by reference

#include<bits/stdc++.h>
using namespace std;
string dp(int i,int j,string s1,string s2,map<pair<int,int>,string> &mp){
  if(i>=s1.size() || j>= s2.size())
    return "";
  if(mp.find({i,j})!=mp.end())
    return mp[{i,j}];
  
  string ans;
  
  if(s1[i]==s2[j])
  {
    ans=s1[i]+dp(i+1,j+1,s1,s2,mp);
  }
  else{
    ans=max(dp(i+1,j,s1,s2,mp),dp(i,j+1,s1,s2,mp));
  }
 
   mp[{i,j}]=ans;
 return ans;
}
int main(){
  string s1,s2;
  cin>>s1>>s2;
  map<pair<int,int> ,string> mp;
  cout<<dp(0,0,s1,s2,mp);
}