I need a string lookup table, which stores static strings (they won't be changing, so I'd like to disallow that.)
I was thinking of std::map
, but I don't know how to make that static. Also, the only way I know to initialize const members in a class is in an initialization list on the constructor, and I don't think I should be initializing a huge table that way.
I also need a composite key, such as:
1. string I want
2. language I want it in
3. units I want it in (metric or US)
I was thinking I could just smoosh that all together into one key, either by concatenating strings (if I use a string key) or adding enumerated numbers (if I make the numbers so they always add up to a unique value).
For the fetching algorithm I may add some logic, such as if there's no match, then see if there's an entry for no units (units don't matter) or no language (answer is the same regardless of language).
Still I don't know how to make std::map
a readonly table and initialize it.