I have a four vectors that I want to sort in relation to each other.
vector<string> color;
vector<string> shape;
vector<int> size;
Each vector is the same size each vector element is tied to each other such that it forms a row
{color[0], shape[0], size[0]}
{color[1], shape[1], size[1]}
{color[2], shape[2], size[2]}, etc
So what I am trying to do is sort the color vector by color and sort the other two vectors based on the rearranged color vector. Then within every group of colors (i.e red) I want to sort by shape and rearrange the size vector based on that sort. And then finally I want to sort the size vector within each group of color and shape. I think I know how to do it but it feels very very messy and difficult to conceptualize/read (I'm still new to C++). Is there an easy way to accomplish something like this?
For example I want to do something like this:
Blue Circle 1 -> Red Triangle 1
Red Triangle 1 -> Red Triangle 2
Blue Circle 3 -> Red Triangle 3
Red Triangle 3 -> Red Circle 1
Red Circle 2 -> Red Circle 2
Blue Triangle 1 -> Red Circle 3
Red Circle 1 -> Blue Triangle 1
Blue Triangle 3 -> Blue Triangle 2
Red Circle 3 -> Blue Triangle 3
Blue Circle 2 -> Blue Circle 1
Blue Triangle 2 -> Blue Circle 2
Red Triangle 2 -> Blue Circle 3