Q:

begin iterator of map not working c++

We have map:
std::map<double, COLORREF> colorset;

Here I provide part of function which returns colorref by value
COLORREF GetColour(double value) const
{
   ...
   for(std::map<double, COLORREF>::iterator ii=colorset.begin(); ii!=colorset.end(); ++ii)
   {
    std::cout << (*ii).first << ": " << (*ii).second << std::endl;
   }
   ...
   return defaultColor;
}

But, compiler gives an error telling about nonexistance of converting from tree_const_iteratortotree_iterator in colorset.begin().
If I delete const term from function everything is OK, but I must declare function as const. 
Why this error is appearing?
Or can someone provide alternate way to iterate though map?

A:

Use const_iterator:    
   for(std::map<double, COLORREF>::const_iterator ii=colorset.begin(); ii!=colorset.end(); ++ii)

PS
I would use ii->first etc

