Graph Breadth First Search

How is this code described in the video could be correct?
I mean when he declared a map named “visited”
that should be declared as

map < int,bool > visited;

not

map < int, int > visited;

logically it should be
map<int ,bool>

but map<int ,int>visited is not wrong

as bool is stored as 0 and 1 internally
so it will also run