Similar to this thread, I'm trying to get the integer index from an iterator but for a map instead of an vector. Atm its causing a large bottle neck in my code and I was wondering if there was a more efficient way to get the index other that what I'm doing currently...
auto itTail = nodesMap.find(tail);
tailNodePos = distance(nodesMap.begin(), itTail);