I am coding a class that has a vector as a private attribute. The type of vector (it can be concurrent_vector from the TBB library or std-vector) is known only at runtime, depending on the parameter specified by the user.
So the question is, how can I code this? I thought something like:
class A {
private:
void* vec;
public:
A( int type ) {
if ( type == 1 ) {
} else {
}
}
};
This conversion, can this be done by reinterpret_cast? Or is there another better way to do this?
I am empty. Thank you for your time.
source
share