c++ define types/call functions based on configuration
<p>In C++, is there a nice technique or design pattern to perform the following tasks based on configuration?</p>

<p><strong>Scenario #1: Call functions</strong><br>
If a configuration says:<br></p>

<p><code>A:foo()</code></p>

<p>Then the code should call A::foo() assuming that the object of A is already accessible.</p>

<p><strong>Scenario #2: Declare type</strong> <br></p>

<p>If a configuration says:<br></p>

<p><code>bar:vector&lt;std::string&gt;</code></p>

<p>Then the code should create an object with the type <code>vector&lt;std::string&gt;</code> in runtime.</p>

<p>String match solution is not desirable.</p>

<p>Thanks in advance.</p>
