I don't understand why this code works:
std::map<int,char> map2;
map2.insert (std::pair<int,char>(3,'a'));
But this doesn't:
std::map<int,double[2]> map1;
map1.insert (std::pair<int,double[2]>(100,{0,0}));
I don't understand why this code works:
std::map<int,char> map2;
map2.insert (std::pair<int,char>(3,'a'));
But this doesn't:
std::map<int,double[2]> map1;
map1.insert (std::pair<int,double[2]>(100,{0,0}));
The answer you are loooking for is here: Using array as map value: can't see the error
Where the last answer explains it as arrays are not assignable or copy constructible, therefore cannot be mapped to.
As an alternative, you can use pointer arrays or vectors.