What is wrong in my code?

#include<bits/stdc++.h>
#include
#include
using namespace std;

template
class Graph
{
map<T,list> l;

public:

void addEdge(int x,int y)
{
    l[x].push_back(y);
    l[y].push_back(x);
}
void bfs(T src)
{
    map<T,int> dist;
    queue<T> q;

    for(auto node_pair:l)
    {
        T node=node_pair.first;
        dist[node]=INT_MAX;      ///declaring every as max integer value
    }
    q.push(src);
    dist[src]=0;                //declaring the src node as 0
    
    while(!q.empty())
    {
        T node=q.front();
        q.pop();
        
        for(int nbr:l[node])
        {
            if(dist[nbr]==INT_MAX)
            {
                q.push(nbr);
                dist[nbr]=dist[nbr]+1;
            }
        }
    }
    ////print the distance of every node
    for(auto node_pair:l)
    {
        T node=node_pair.first;
        int d=dist[node];
        cout<<"Node:"<<node<<" Distace from src:"<<d<<endl;
    }
}

};

int main()
{
Graph g;
g.addEdge(0,1);
g.addEdge(0,3);
g.addEdge(1,2);
g.addEdge(2,3);
g.addEdge(3,4);
g.addEdge(4,5);
g.bfs(0);
}

Please save your code on ide.codingblocks.com and then share its link.

If your doubt is resolved now, please mark it as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.