Question : Dinkum template library "map" syntax


Hello, wondering if I could get a quick opinion on what this map template line of code is doing in the constructor of our review-subject's code:

void ComReactor::SetReactor(ComReactor * reactor)
{
map<int, ComReactor *, less<int> >:: iterator iter;
...
...
}

we are reviewing code from a commercial vendor, neither of my associates or I have any experience with Dinkum (or C++ templates), so we're not sure if that is declaring an object or not.  Or is it making the whole class "enumerable" in some way?

Answer : Dinkum template library "map" syntax

It actually declares a STL 'map' iterator (http://www.sgi.com/tech/stl/Map.html) which is used to iterator throug a std::map' which uses integers (the 1st template argument) as the key and maps these to a pointer to a 'ComReactor' object with the comparator used being 'less()' (http://www.sgi.com/tech/stl/less.html).
Random Solutions  
 
programming4us programming4us