Thanks a lot. Actually all I need to write a vector of struct to a CSV file which the struct contain over 80 element(fields). Therefore I want some way to access the same element in different ways. When processing, MemberParam.Weight, when write it out, MemberParam[0] so that a simple for loop is good enough.
you can use an enum to name array/vector locations.
enum locs
{
height,weight, age, ... etc
max_locs //always have a max, many reasons...
};
vector<int> thing(max_locs); //see how max can be handy? It grows automatically if you add to the enum.
thing[weight]; //access 0th element with a useful name.
this may or may not be something akin to what you asked... a simple vector & enum are a very solid data structure for simple tasks...