Saturday, July 13, 2013

Sorting vector Multiple Ways

Newsgroup: comp.lang.c++

Subject: Sorting vector Multiple Ways

From: mrc2323@...

Date: Sat, 13 Jul 2013 14:35:45 -0700



Is there a way to sort the vector below in more than one way? The

code below works, but I find a need to sort and search on a second field

(eName). Is this possible? TIA



class MyEvents

{

public:

bool bIsScored;

int eSeq;

double eDist;

string evKey;

string eRoot;

string eEvent;

string eDate;

string eYear;

string eCode;

string eName;

bool operator<(MyEvents rhs) { return evKey < rhs.evKey; }

};

vector<MyEvents> evVect;

vector<MyEvents>::const_iterator evIter;







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?41753-Sorting-vector-Multiple-Ways&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment