Best way to store constant data in C++
<p>I have an array of constant data like following:</p>

<pre><code>enum Language {GERMAN=LANG_DE, ENGLISH=LANG_EN, ...};
struct LanguageName {
    ELanguage language;
    const char *name;
};

const Language[] languages = {
    GERMAN, "German",
    ENGLISH, "English",
    .
    .
    .
};
</code></pre>

<p>When I have a function which accesses the array and find the entry based on the Language enum parameter. Should I write a loop to find the specific entry in the array or are there better ways to do this.</p>

<p>I know I could add the LanguageName-objects to an std::map but wouldn't this be overkill for such a simple problem? I do not have an object to store the std::map so the map would be constructed for every call of the function.</p>

<p>What way would you recommend?</p>

<p>Is it better to encapsulate this compile time constant array in a class which handles the lookup?</p>
