map library

I've been trying to play a little with the map library, see how it works and what I can do with it...
And I couldn't find a way to use something like map<int[3], char> vetorR3
I am asking this just as a curiosity, but I'm sure it's quite simple and it just didn't hit me yet...

Thanks to anyone willing to help me out
A std::map (class/object -- it's not a library, but a part of the library, just as a single book is not a library) expects the key object to have some order criterion attached to it.

An int[3] is the same as an int*, which is just a pointer, so your map will not do the things you likely want it to do.

Create specialized class or use a std::vector<int>. In both cases, make sure your keys know how to compare themselves to each other or provide a comparitor when you instantiate the std::map.

Make sure to check out the Reference section, which is replete with examples.

Hope this helps.
Topic archived. No new replies allowed.