Error Id to Error String mapping - implementation in C++
<p>I am implementing a class that will handle the error messages for my application. The primary requirement for this class will be</p>

<ol>
<li><p>Store the error id to string mapping( during compile time)</p>

<p>0, "No Error"</p>

<p>147, "Invalid Input"</p>

<p>.
.
.</p>

<p>2500, "Unknown error"</p></li>
<li><p>A method <code>const std::string&amp; getErrorString(int errorId)</code> that will retrieve the string from the mapping</p></li>
</ol>

<p>The errorIds are not contiguous, because I am going to assign ranges for modules. I was considering using a map to store the mapping, but this would mean that I would have to insert the error strings into the map at run-time - I am not sure if this is efficient, as all errors are available during compilation itself.</p>

<p>What is the best way to implement the error id to string mapping to allow for efficient retrieval and optimal run time?
I do not have boost.</p>
