I have a Vector of objects. Each object has three fields-
int v1, v2, v3;
I need to arranged this list of objects so that they are ascending by these values. What I mean by this is that v1 is ordered first, and then if v1 is the same in any objects, v2 is ordered and if v2 is the same v3 is ordered- like when you order words alphabetically, first you order the first character then the second and so on.
I know what I'm trying to say may sound confusing, please tell me if I need to reword it
Therefore I need to get my input:
object 1: v1 = 5, v2 = 6, v3 = 1;
object 2: v1 = 7, v2 = 5, v3 = 3;
object 3: v1 = 5, v2 = 1, v3 = 3;
object 4: v1 = 2, v2 = 5, v3 = 5;
object 5: v1 = 8, v2 = 4, v3 = 6;
to be ordered like this:
object 4: v1 = 2, v2 = 5, v3 = 5;
object 3: v1 = 5, v2 = 1, v3 = 3;
object 1: v1 = 5, v2 = 6, v3 = 1;
object 2: v1 = 7, v2 = 5, v3 = 3;
object 5: v1 = 8, v2 = 4, v3 = 6;
As you can see object 3 and 1 have the same v1, therefore they are ordered by v2
Please tell me if I need to elaborate further