objects and trolls

P

Paul

I believe Leighs has made a few incorrect statements about objects in C++. I
would resond to his post but since his is a troll thread I don'#t want to be
involved with that.

Here are some correct facts:

In C++ member functions come in two flavours static and nonstatic.
a)A static member function is a member of only the class and it is not
associated with any object.
b) a nonstatic member function is associated with an object( an instance of
a class type)


In C++ an object is not *simply* a region of strogare as Leigh incorrectly
states. The C++ standards defines an object as a region of storage. Note:
there is no "simply" in the definition.
Now the word object here has a different meaning because the stadard used
the word object to mean lots of things, for example, in the standard:
a pointer is an object,
a built-in type is an object,
almost anything is an object in the context of the C++ standard.
This is certainly not consistent with the general use of the word object in
the context of an instance of a class type.
Saying a member function is 'part of' an object is an OOP concept and the
context of the word 'object' here is not the same as in the C++ standard. It
is not necessarry for the function code to literally reside in the same
memory location as its respective object for it this concept to be
acceptable.
Leigh is taking the word 'object' from the context of the C++ standard and,
after tweaking the definition by adding the word 'simply', applying it
inappropriately. It is possible for the C++ standard to use the word object
in its own context because the C++ standard is not intended as a reference
for all possible implementations of C++ OOP mechanisms.


The member function is dependant on the existence of the object. To support
OOP, which the C++ language does, the implementation of a nonstatic member
function must support the concept that it's a member of an object.
With Leigh's suggestion that objects are simple storage regions with no
member functions, this does not support OOP, but C++ does support OOP so
Leighs interpretation must be wrong.

Note: Leigh also blabs on about machine code, best to ignore that I think he
is desperately looking for a way to prove me incorrect after he took a
beating on the old asm discussion ;-)
 
P

Paul

Leigh Johnston said:
In C++ a member function is a member of a class not a member of an object;
in C++ an object is simply a region of storage; in C++ a non-static member
function is *invoked* on an object it is not part of an object.

Rubbish , if this was the case C++ would not support OOP.
Members declared in a class are part of an object of that class type, unless
declared static.
You obviously fail to accept this.
 
J

James Kanze

I believe Leighs has made a few incorrect statements about
objects in C++. I would resond to his post but since his is
a troll thread I don'#t want to be involved with that.

So you prefer creating another troll thread.

From the jargon file:

troll:
1. To utter a posting on Usenet designed to attract predictable
responses or flames; or, the post itself. [...]
2. An individual who chronically trolls in sense 1;[...]
Here are some correct facts:

The argument is purely linguistic, which means that the only
relevant fact is what either the authorities (the C++ standard),
or a consensus within the target community (the C++ users
community).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top