Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

c++ sort vector of objects by property

class cat {
public:
    int age;
    bool operator< (const cat &other) const {
        return age < other.age;
    }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #vector #objects #property
ADD COMMENT
Topic
Name
9+1 =