Full the linked list with void* pointer, which is actually the pointer of your struct Variable.
Like this:
#include <list>
struct S1
{
int x;
int y;
};
struct S2
{
int x;
int y;
int z;
};
void main()
{
std::list<void*> mylist;
S1 s1; s1.x = 1; s1.y = 1;
S2 s2; s2.x = 2; s2.y = 2; s2.z = 2;
mylist.insert(mylist.end(), &s1);
mylist.insert(mylist.end(), &s2);
S1* pS1 = NULL;
S2* pS2 = NULL;
pS1 = (S1*)mylist.front();
pS2 = (S2*)mylist.back();
printf("s1 x=%d, y=%d\n", pS1->x, pS1->y);
printf("s2 x=%d, y=%d, z=%d\n", pS2->x, pS2->y, pS2->z);
}