alex_merlin_1985 wrote: > I know about this approach, but the problem is that there will be a > very big number of possible keys (billions), where only a few (max 10) > of them will be set/needed, and this can't be modified... >
It sounds like you need a sparse array. Have you considered using a std::map? You can use it just like an array (except for construction/destruction) and it will handle storage automatically. It even has methods to test whether a specific key (similar to an array index) exists. -- John Gaughan
