What is wrong in this code as I am getting segmentation fault It seems returning map by value is not problematic.
#include<bits/stdc++.h>
using namespace std;
template<typename T>
T myMapIntersect(T& left, T& right)
{ }
int main()
{
    map<string, int> m;
    m["aa"] = 1;
    m["bb"] = 1;
    m["vf"] = 1;
    m["hh"] = 1;
    myMapIntersect< map<string,int> >(m, m);
    return 0;
}
 
     
    