![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,203
Rep Power: 5
![]() |
Quote:
People who care about the ability of customers to use their class library are often notable for insisting that public members appear near the top of a class declaration. That probably means that people who prefer private members near the top are more concerned with making it easier to modify the class implementation, and less concerned about the impact that has on other people who use their classes. |
|
|
|
|
|
|
#12 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
)
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
|
#13 | |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4
![]() |
Quote:
![]()
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand." - B. Russell http://web.bryant.edu/~srk2 |
|
|
|
|
|
|
#14 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,203
Rep Power: 5
![]() |
Quote:
The only difference between a C++ struct and a C++ class is that, by default, all members of a struct are public and all members of a class are private. Again, this is required by the C++ standard. The fact that it is (relatively) common practice to place public members near the top of a class declaration is a style guideline. With liberal use of public, protected, and private keywords you can declare class (or struct) members in any order you wish. In other words, the C++ standard allows you to order member functions in a class declaration any way you wish, regardless of how good your approach is according to style guides. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|