Question

Let's say I have a few variables of different types.

int MyInteger;
double MyDouble;
char MyChar;

Pointers to these variables are stored in a single array of void pointers.

void* IntegerPointer = &MyInteger;
void* DoublePointer = &MyDouble;
void* CharPointer = &MyChar;

void* PointerArray[] = {IntegerPointer, DoublePointer, CharPointer};

I'd like to store the datatype information in a parallel array. type_info seems to be suited to the task, but assignment isn't supported. So I can't just do something like this:

type_info TypeInfoArray[] = {int, double, char};

Is there any other way to store information about a datatype?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top