This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: locale/file/style questions



> > I suggest that everything public should be before everything private.
> > That way consumers can read from top down and stop when they see
> > that the rest of the class definition is private, thus of no concern.
> 
> I posted the original comment just to see if
> anybody had any strong feelings, or any particular technique that was
> working well for their own code. 

In general, for public classes, typedefs first, other public stuff next, 
then protected, and private last.  A typedef needed only for a single 
function or group of them might go next to the function. 

The goal is, keep the private stuff out of the way; otherwise, 
make the class definition understandable to users.
Guidelines can help at this, but when they interfere it must be
the guideline that yields.

Nathan Myers
ncm@cantrip.org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]