Click here to Skip to main content
15,914,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDoubts with sorting stl vector... Pin
Cloaca10-Feb-04 9:32
Cloaca10-Feb-04 9:32 
GeneralRe: Doubts with sorting stl vector... Pin
David Crow10-Feb-04 10:05
David Crow10-Feb-04 10:05 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca10-Feb-04 10:14
Cloaca10-Feb-04 10:14 
GeneralRe: Doubts with sorting stl vector... Pin
David Crow10-Feb-04 10:34
David Crow10-Feb-04 10:34 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca11-Feb-04 6:48
Cloaca11-Feb-04 6:48 
GeneralRe: Doubts with sorting stl vector... Pin
valikac10-Feb-04 10:07
valikac10-Feb-04 10:07 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca10-Feb-04 10:18
Cloaca10-Feb-04 10:18 
GeneralRe: Doubts with sorting stl vector... Pin
jhwurmbach11-Feb-04 1:51
jhwurmbach11-Feb-04 1:51 
Cloaca wrote:
Is it the case that I need to add additional structs under the private section of CFoo for each comparison CFoo member function I want to write [...]?

Yes. AFAIK every comparison need its own comparer (like you have with the NameComparer)

Cloaca wrote:
3) Why do I need to wrap the comparison functions in a struct? How does that fact relate to operator(), etc.?

struct does mean the same as class, but everything is public by default.
As you only want a class with only one public operator, writing struct instead of class does save you a whopping 6 keystrokes (7 for 'public' plus the ':', minus one because struct is longer than class.

I think that is the only reason.


"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."

-- Caius Petronius, Roman Consul, 66 A.D.

GeneralRe: Doubts with sorting stl vector... Pin
Cloaca11-Feb-04 6:57
Cloaca11-Feb-04 6:57 
GeneralRe: Doubts with sorting stl vector... Pin
antlers11-Feb-04 11:37
antlers11-Feb-04 11:37 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca12-Feb-04 4:22
Cloaca12-Feb-04 4:22 
Generalfatal crash on win98 & winMe, Need help. Pin
haritadala10-Feb-04 7:43
haritadala10-Feb-04 7:43 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
David Crow10-Feb-04 7:49
David Crow10-Feb-04 7:49 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
haritadala10-Feb-04 8:40
haritadala10-Feb-04 8:40 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
John R. Shaw10-Feb-04 10:57
John R. Shaw10-Feb-04 10:57 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
Peter Weyzen10-Feb-04 11:35
Peter Weyzen10-Feb-04 11:35 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
haritadala10-Feb-04 15:59
haritadala10-Feb-04 15:59 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
Peter Weyzen10-Feb-04 16:06
Peter Weyzen10-Feb-04 16:06 
GeneralEnum a directory.. Pin
RobJones10-Feb-04 6:06
RobJones10-Feb-04 6:06 
GeneralRe: Enum a directory.. Pin
Steve S10-Feb-04 6:09
Steve S10-Feb-04 6:09 
GeneralRe: Enum a directory.. Pin
RobJones10-Feb-04 6:17
RobJones10-Feb-04 6:17 
Generalnever mind my last post.. it works fine.. Pin
RobJones10-Feb-04 6:28
RobJones10-Feb-04 6:28 
GeneralRe: never mind my last post.. it works fine.. Pin
David Crow10-Feb-04 7:13
David Crow10-Feb-04 7:13 
GeneralRe: never mind my last post.. it works fine.. Pin
RobJones10-Feb-04 9:32
RobJones10-Feb-04 9:32 
GeneralRe: Enum a directory.. Pin
John M. Drescher10-Feb-04 10:26
John M. Drescher10-Feb-04 10:26 

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.