I do not understand why I cannot have unordered_map with array<int,3> as the key type:
#include <unordered_map> using namespace std; int main() { array<int,3> key = {0,1,2}; unordered_map< array<int,3> , int > test; test[key] = 2; return 0; }
I get a long error, the most appropriate part of which is
main.cpp:11:9: error: no match for 'operator[]' (operand types are std::unordered_map<std::array<int, 3ul>, int>' and 'std::array<int, 3ul>') test[key] = 2; ^
Are arrays not matching keys because they miss some requirements?
source share