typedef pair<unsigned char, unsigned char> pair_k;
map<unsigned char, pair_k> mapping;
Which will be used this way:
mapping[100] = make_pair(10,10);
Question is:
- Is this allowed? Syntaxically, it feels alright.
- Would this be access as an array as oppose to a map?
That looks ok to me. But note that this is not array access; it just looks like it because
std::mapoverloadsoperator[]. If you domapping.size()afterwards, you will find that it will be1.