Click here to Skip to main content
16,010,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++? Visual C++? Pin
Christian Graus30-Nov-00 14:52
protectorChristian Graus30-Nov-00 14:52 
GeneralBug in MFCGridControl Pin
29-Nov-00 7:20
suss29-Nov-00 7:20 
GeneralRe: Bug in MFCGridControl Pin
Erik Funkenbusch29-Nov-00 10:10
Erik Funkenbusch29-Nov-00 10:10 
GeneralRe: Bug in MFCGridControl Pin
Michael Dunn29-Nov-00 17:09
sitebuilderMichael Dunn29-Nov-00 17:09 
QuestionHow to sort std::list&ltCMyClass*&gt? Pin
Matt Weagle29-Nov-00 5:46
Matt Weagle29-Nov-00 5:46 
AnswerRe: How to sort std::list&ltCMyClass*>? Pin
Erik Funkenbusch29-Nov-00 10:20
Erik Funkenbusch29-Nov-00 10:20 
AnswerRe: How to sort std::list&ltCMyClass*>? Pin
Michael S. Scherotter29-Nov-00 11:38
Michael S. Scherotter29-Nov-00 11:38 
GeneralRe: How to sort std::list&ltCMyClass*>? Pin
Andy Hassall29-Nov-00 12:01
Andy Hassall29-Nov-00 12:01 
template<class Pred>
void sort(greater<T> pr);

So you want the predicate reversed, surely?

std::list theList

// function object, a bit more 'STL-style'
class CMyBaseClassGreater {
public:
bool operator()(CMyBaseClass* pFirst, CMyBaseClass* pSecond)
{
return *pFirst > *pSecond;
}
}

theList.sort(CMyBaseClassGreater());

std::sort won't work on a list, as it needs random access iterators, which list doesn't provide. You have to use std::list::sort().

GeneralRe: How to sort std::list&ltCMyClass*>? Pin
Matt Weagle29-Nov-00 13:00
Matt Weagle29-Nov-00 13:00 
GeneralRe: How to sort std::list&ltCMyClass*>? Pin
Tim Burke8-Dec-00 10:42
Tim Burke8-Dec-00 10:42 
GeneralYou can do it if you fix Microsoft's bugs. Pin
Jonathan Gilligan12-Dec-00 13:32
Jonathan Gilligan12-Dec-00 13:32 
GeneralProblem with CToolBar and EnableButton() Pin
Anders Molin29-Nov-00 1:37
professionalAnders Molin29-Nov-00 1:37 
GeneralRe: Problem with CToolBar and EnableButton() Pin
Erik Funkenbusch29-Nov-00 10:22
Erik Funkenbusch29-Nov-00 10:22 
GeneralRe: Problem with CToolBar and EnableButton() Pin
Anders Molin29-Nov-00 22:21
professionalAnders Molin29-Nov-00 22:21 
GeneralProblems with MRU list!!! Pin
Grit29-Nov-00 0:53
Grit29-Nov-00 0:53 
GeneralWincap32 Pin
28-Nov-00 22:43
suss28-Nov-00 22:43 
GeneralProblem with String Table Pin
28-Nov-00 21:49
suss28-Nov-00 21:49 
GeneralRe: Problem with String Table Pin
28-Nov-00 22:52
suss28-Nov-00 22:52 
GeneralRe: Problem with String Table Pin
3-Dec-00 20:50
suss3-Dec-00 20:50 
GeneralRe: Problem with String Table Pin
3-Dec-00 21:18
suss3-Dec-00 21:18 
GeneralMessages/Event with Dialog Pin
28-Nov-00 13:26
suss28-Nov-00 13:26 
GeneralWriting Network programs using Visual C++ Pin
28-Nov-00 11:24
suss28-Nov-00 11:24 
GeneralRe: Writing Network programs using Visual C++ Pin
29-Nov-00 7:22
suss29-Nov-00 7:22 
GeneralMupliply inheritance Pin
Eugene Karpov28-Nov-00 7:57
Eugene Karpov28-Nov-00 7:57 
GeneralRe: Mupliply inheritance Pin
Erik Funkenbusch28-Nov-00 12:51
Erik Funkenbusch28-Nov-00 12:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.