Click here to Skip to main content
15,917,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: list control Pin
FarPointer10-Jul-06 6:00
FarPointer10-Jul-06 6:00 
GeneralRe: list control Pin
jokefake10-Jul-06 6:44
jokefake10-Jul-06 6:44 
QuestionSorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 5:26
Harold_Wishes10-Jul-06 5:26 
QuestionRe: Sorting a list with class for complex types Pin
David Crow10-Jul-06 5:31
David Crow10-Jul-06 5:31 
AnswerRe: Sorting a list with class for complex types Pin
Jun Du10-Jul-06 5:35
Jun Du10-Jul-06 5:35 
AnswerRe: Sorting a list with class for complex types [modified] Pin
FarPointer10-Jul-06 6:29
FarPointer10-Jul-06 6:29 
GeneralRe: Sorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 7:02
Harold_Wishes10-Jul-06 7:02 
GeneralRe: Sorting a list with class for complex types [modified] Pin
FarPointer10-Jul-06 7:28
FarPointer10-Jul-06 7:28 
QuestionRe: Sorting a list with class for complex types Pin
David Crow10-Jul-06 7:36
David Crow10-Jul-06 7:36 
AnswerRe: Sorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 7:48
Harold_Wishes10-Jul-06 7:48 
GeneralRe: Sorting a list with class for complex types [modified] Pin
FarPointer10-Jul-06 7:54
FarPointer10-Jul-06 7:54 
GeneralRe: Sorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 8:09
Harold_Wishes10-Jul-06 8:09 
GeneralRe: Sorting a list with class for complex types Pin
FarPointer10-Jul-06 8:18
FarPointer10-Jul-06 8:18 
GeneralRe: Sorting a list with class for complex types Pin
Harold_Wishes10-Jul-06 8:33
Harold_Wishes10-Jul-06 8:33 
GeneralRe: Sorting a list with class for complex types Pin
David Crow10-Jul-06 9:11
David Crow10-Jul-06 9:11 
GeneralRe: Sorting a list with class for complex types Pin
Zac Howland10-Jul-06 8:39
Zac Howland10-Jul-06 8:39 
GeneralRe: Sorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 9:01
Harold_Wishes10-Jul-06 9:01 
GeneralRe: Sorting a list with class for complex types Pin
Zac Howland10-Jul-06 9:25
Zac Howland10-Jul-06 9:25 
You can either use the general sort algorithm (std::sort) or write a specialized less<MyData>() functor that looks something like:


struct std::less<MyData>
{
	bool operator()(const MyData& lhs, const MyData& rhs)
	{
		return lhs.m_iData < rhs.m_iData;
	}
};


And then call mylist.sort(std::less<MyData>).

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac
GeneralRe: Sorting a list with class for complex types Pin
David Crow10-Jul-06 8:18
David Crow10-Jul-06 8:18 
GeneralRe: Sorting a list with class for complex types Pin
FarPointer10-Jul-06 8:26
FarPointer10-Jul-06 8:26 
GeneralRe: Sorting a list with class for complex types Pin
David Crow10-Jul-06 8:39
David Crow10-Jul-06 8:39 
GeneralRe: Sorting a list with class for complex types [modified] Pin
Harold_Wishes10-Jul-06 7:35
Harold_Wishes10-Jul-06 7:35 
GeneralRe: Sorting a list with class for complex types Pin
FarPointer10-Jul-06 7:44
FarPointer10-Jul-06 7:44 
AnswerRe: Sorting a list with class for complex types Pin
earl10-Jul-06 9:29
earl10-Jul-06 9:29 
GeneralRe: Sorting a list with class for complex types Pin
Harold_Wishes10-Jul-06 10:49
Harold_Wishes10-Jul-06 10:49 

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.