Iterate over vector of pair
There are at least three errors in the loop.
for ( vector < pair<float,pair<int,int>> >::const_iterator it = edges.begin() ; itt != edges.end; it++){
cout >> it.first;
}
First of all you have to use edges.end()
instead of edges.end
. And inside the body there has to be
cout << it->first;
instead of
cout >> it.first;
To escape such errors you could write simply
for ( const pair<float, pair<int,int> > &edge : edges )
{
std::cout << edge.first;
}
C++14 iterators are a lot simpler
for (const auto& pair : edges)
{
std::cout << pair.first;
}
C++17 iterators allow deeper access
for (const auto& [first, sec] : edges)
{
std::cout << first;
}