How would I go about calling a function from a preprocessor in C++?
<p>I have multiple classes. I want to store them all in a map array. </p>

<pre><code>std::map&lt;std::string, ClassMaker*&gt; lookupTable;
</code></pre>

<p>I think it would be pretty inefficient if I do something similar to</p>

<pre><code>void addClass(std::string className, ClassMaker* const classMaker);
addClass("Class1", new Class1());
addClass("Class2", new Class2());
</code></pre>

<p>and so on.</p>

<p>I was curious if there was some way I could go about doing this with preprocessors, something in the terms of</p>

<pre><code>#DEFINE_CLASS(Class) 

DEFINE_CLASS(Class1)
</code></pre>

<p>and it will store the class in a map so I can access it later.</p>