//Works
cout << "map[0] value is " << doubleStatsMap.begin()->first<< endl;
//gives error
cout << "map[last value is " << doubleStatsMap.end()->first << endl;
Im simply trying to get the value of the last element of my map. It works correctly with "map.begin->first" but is giving "map/set iterator not dereferencable" for the "map.end()->first". It cant be empty as the map has a beginning thus it has an end. Everything I've read says this should work. Any suggestions greatly appreciated!