I want to define something like
Map myMap;
The above declaration is accepted by c++ compiler and no error is thrown bu
You cannot use an array in a standard container.
Use an std::vector
instead of an array
Use a map of pointers to arrays of 5 elements.
Use boost tuples instead of arrays of 5 elements.
Instead of using an array make a new struct
that takes 3 elements. Make the map
. Or wrap your array in a struct
and that will work too.
\
struct ArrayMap
{
int color[5];
};
/