1 2 3 4 5 6 |
typedef struct { int nNumber; int nTimeSeconds; int nConnections; } STasks; |
1 2 3 4 5 6 7 |
struct STaskSortAscending { bool operator() ( STasks& r_pElemStart, STasks& r_pElemEnd ) { return r_pElemStart.nNumber < r_pElemEnd.nNumber; } }; |
1 2 3 4 5 6 7 |
struct STaskSortDescending { bool operator() ( STasks& r_pElemStart, STasks& r_pElemEnd ) { return r_pElemStart.nNumber < r_pElemEnd.nNumber; } }; |
1 |
std::sort( m_vecTasks.begin(), m_vecTasks.end(), STaskSortAscending() ); |