Is it possible to initialize a vector with named variables?

Suppose I have individually named variables, and I want to put them in a vector. Just for illustration purposes, say they look like this:

1
2
float height, width, length, area, volume;
vector<float> properties = {height, width, length, area, volume};


Is there a less redundant way to do this, such that I can create a vector or array of named variables without first declaring the variables seperately?
vector of named variables??? not in C++(at least currently). Look up dictionaries(std::map).

Aceix.
Last edited on
Topic archived. No new replies allowed.