Click here to Skip to main content
15,899,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSorting a vector of a user defined type Pin
avimitrani12-Sep-06 4:21
avimitrani12-Sep-06 4:21 
AnswerRe: Sorting a vector of a user defined type Pin
Rob Caldecott12-Sep-06 4:29
Rob Caldecott12-Sep-06 4:29 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 5:26
avimitrani12-Sep-06 5:26 
GeneralRe: Sorting a vector of a user defined type Pin
Rob Caldecott12-Sep-06 5:32
Rob Caldecott12-Sep-06 5:32 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 6:00
avimitrani12-Sep-06 6:00 
GeneralRe: Sorting a vector of a user defined type Pin
Zac Howland12-Sep-06 6:29
Zac Howland12-Sep-06 6:29 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 7:10
avimitrani12-Sep-06 7:10 
GeneralRe: Sorting a vector of a user defined type Pin
Zac Howland12-Sep-06 8:11
Zac Howland12-Sep-06 8:11 
The only problem you will run into is if the item_calculation struct is a private inner class, the opeartor< will be "private", so it won't be able to be used outside the outer class (that is, sort may have issues with it). That goes away if it is a public inner class, or if you override the operators outside the class.

There are other reasons to override binary operators outside the class they operate on, but that goes beyond the scope of this question.

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

AnswerRe: Sorting a vector of a user defined type [modified] Pin
Zac Howland12-Sep-06 4:30
Zac Howland12-Sep-06 4:30 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 5:14
avimitrani12-Sep-06 5:14 
GeneralRe: Sorting a vector of a user defined type Pin
Chris Losinger12-Sep-06 5:16
professionalChris Losinger12-Sep-06 5:16 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 5:42
avimitrani12-Sep-06 5:42 
GeneralRe: Sorting a vector of a user defined type Pin
Zac Howland12-Sep-06 5:40
Zac Howland12-Sep-06 5:40 
GeneralRe: Sorting a vector of a user defined type Pin
avimitrani12-Sep-06 5:49
avimitrani12-Sep-06 5:49 
GeneralRe: Sorting a vector of a user defined type Pin
Zac Howland12-Sep-06 6:17
Zac Howland12-Sep-06 6:17 
QuestionConvert from CStringW to CString Pin
zizzzz12-Sep-06 4:05
zizzzz12-Sep-06 4:05 
AnswerRe: Convert from CStringW to CString Pin
Rob Caldecott12-Sep-06 4:31
Rob Caldecott12-Sep-06 4:31 
GeneralRe: Convert from CStringW to CString Pin
zizzzz12-Sep-06 4:53
zizzzz12-Sep-06 4:53 
GeneralRe: Convert from CStringW to CString Pin
Rob Caldecott12-Sep-06 4:58
Rob Caldecott12-Sep-06 4:58 
AnswerRe: Convert from CStringW to CString Pin
Rinu_Raj12-Sep-06 4:35
Rinu_Raj12-Sep-06 4:35 
GeneralRe: Convert from CStringW to CString Pin
zizzzz12-Sep-06 5:21
zizzzz12-Sep-06 5:21 
GeneralRe: Convert from CStringW to CString Pin
David Crow12-Sep-06 7:15
David Crow12-Sep-06 7:15 
AnswerRe: Convert from CStringW to CString Pin
wiemounir12-Sep-06 5:17
wiemounir12-Sep-06 5:17 
GeneralRe: Convert from CStringW to CString Pin
Hamid_RT13-Sep-06 8:11
Hamid_RT13-Sep-06 8:11 
GeneralRe: Convert from CStringW to CString Pin
wiemounir13-Sep-06 23:06
wiemounir13-Sep-06 23:06 

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.