Dynamically change the type of a class attribute
<p>I'm coding a class that has a vector as a private attribute.
The type of the vector ( it can be a concurrent_vector from the TBB library or a std vector) is only known at runtime, depending on a parameter specified by the user.</p>

<p>So the question is, how can I code that? I thought something like:</p>

<p><pre><code>
class A {
  private:
     void* vec;
  public:
    A( int type ) {
       if ( type == 1 ) {
         // convert the void* into std::vector&lt;>
      } else {
         // convert into a tbb::concurrent_vector
      }
  }
};
</pre></code></p>

<p>That conversion, could it be done by a reinterpret_cast? Or is there another better way to do this?</p>

<p>I'm in blank.
Thanks for your time.</p>
