Используйте std::array
:
#include <array>
#include <iostream>
#include <map>
int
main()
{
using key_type = std::array<char, 10>;
std::map<key_type, int> m;
key_type c{ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
m[c] = 78;
}
Если вы хотите переменный размер, используйте std::string_view
:
#include <iostream>
#include <map>
#include <string_view>
int
main()
{
std::map<std::string_view, int> m;
char c[10] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
m[{c, sizeof(c)}] = 78;
}