I have vector of pointers to the objects. These objects have 2 properties, lets say: int strenght and int age. I want to sort this vector by int strenght but if there are same objects with the same int strenght then these obcjects should be sorted by int age. How can I do this in C++?
            Asked
            
        
        
            Active
            
        
            Viewed 136 times
        
    1
            
            
         
    
    
        SigGP
        
- 716
- 1
- 11
- 24
- 
                    what did you try and how does it fail? – 463035818_is_not_an_ai Apr 18 '17 at 20:02
- 
                    I tried to sort vector by age and after then by strenght. I used sort function from. The result looks fine but I don't know if I can be certain that the result will be always currect. – SigGP Apr 18 '17 at 20:22