Home

spekyuman <spekyuman@gmail.com> wrote in message...
>
> yes, parashift is amazing, good reference, visit it frequently...
> however, i must insist that these questions are related to this
> newsgroup in every sense... the questions listed above require c++
> language, compile-time knowledge and merely question the correct usage
> of these language semantics... lets see if you cannot reference
> parashift and answer my question now?
>

> > How should members and their operations be handled in a general sense,
> > while considering effeciency and portability top priority?

Profile!

Provide some context for your questions. 'in general' gets an 'in general'
answer (like I suggested).


> > QUESTION: Should all class members be implemented as pointers?
> > Why or why not?

No. Because it isn't required in all cases. (POD struct/class).

> > QUESTION: Should all parameters be implemented as references?
> > Why or why not?

No. Because it isn't required in all cases. (POD struct/class).

> > QUESTION: "One can always return objects from class methods by
> > reference, either const or non-const. A user can take the address of
> > the reference, if necessary, to save the object. There are no
> > drawbacks to returning objects always as pointers." (Referring to the
> > statement that all objects should be implemented with pointer
> > members.) Are there any drawbacks when this is the case?

I can't answer that one, "Homey don't play that!". I use references where I
can, and pointers if I have to. Context?

"always" is a hang-up. You never do "always" in C++ design (....only for
standard conformance).

Answers are my *opinion*. Refer to the 'standard' for solid answers.

--
Bob R
POVrookie

previous
next

Re: array as member of class
Re: super() doesn't get superclass
"this" question
Re: Printing lists in columns (was: TypeError: 'module object is not callable')
Re: C# and Python
Podaruj Zycie
Kidprotect
Fundacja Iskierka
Mimo Wszystko
Fundacja Sloneczko