I've constructed a map which has a vector as its key: map<vector<KeyT>, T>
which I'm trying to optimize now.
An experiment with manually nested maps map<vector<KeyT>, map<KeyT,T> >
where the first key is the original vector minus the last element and the second key is the last element shows a reasonable speed-up.
Now I'm wondering whether there exists a semi-standard implementation (like boost or similar) of an associative container where vector keys are implemented as such a hierarchical structure of containers.
Ideally, this would create as many layers as there are elements in the key vector, while keeping a uniform syntax for vectors of different length.