Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   member functions (http://www.velocityreviews.com/forums/t741580-member-functions.html)

Paul 01-06-2011 11:27 AM

member functions
 
A member functions is part of an object. true or false?

To me a member funtion is part of an object by definition.

However some people like to argue that a member function is not considered
part of an object.. They've suggested that because a function is not stored
within an object in memory thisa is evidence to suggest that an object does
not have member functions.

A member function is definined in an objects class
An objects' class is the definition of an object type and any functions
defined within that class are member of that given object type.
A member function IS by definition a member of an object.

It seems some people cannot see past the fact that a paragraph in the
standards states an object to be a region of memory. They seem to interpet
this to mean that nothing can be part of that object unless it is stored
within the same region of memory.
I have and I still do argue with these people as I think its quite clear
they're view is very narrow minded and not a good way to think about objects
and object types.






Bart van Ingen Schenau 01-06-2011 02:39 PM

Re: member functions
 
On Jan 6, 12:27*pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> A member functions is part of an object. true or false?


False.
A member function is part of a class. A class is not the same as an
object, but rather defines a possible type for an object.
A class provides a blueprint for the layout of an object and it tells
the compiler in which constructions an object of that type can be
used.

>
> To me a member funtion is part of an object by definition.


Then you are using different definitions that I am and the other C++
programmers that I know.

>
> However some people like to argue that a member function is not considered
> part of an object.. They've suggested that because a function is not stored
> within an object in memory thisa is evidence to suggest that an object does
> not have member functions.
>
> A member function is definined in an objects class
> An objects' class is the definition of an object type and any functions
> defined within that class are member of that given object type.
> A member function IS by definition a member of an object.


Sorry, but that conclusion does not follow from the preceding
statements.

First, member functions do not have to be defined in a class. It is
also possible to declare members in the class and define them outside
the class.

Secondly, a class provides indeed a definition of an object type, and
any function declared in the class is a member of the class. This is
true for both static and non-static members.

If your conclusion followed logically from the preceding statements,
then static member functions would also be members of an object, even
though they can be used without ever declaring an object of that type.
Additionally, there is a step missing where you show that members of a
class are by necessity also members of an instance of that class,
instead of operating on such an instance.

Bart v Ingen Schenau

Paul 01-06-2011 03:42 PM

Re: member functions
 

"Bart van Ingen Schenau" <bart@ingen.ddns.info> wrote in message
news:666db0c3-1a98-4997-9880-2e59750bbd33@z19g2000yqb.googlegroups.com...
On Jan 6, 12:27 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> A member functions is part of an object. true or false?


>False.


You are entitled to your opinion.

GL!


Victor Bazarov 01-06-2011 03:58 PM

Re: member functions
 
On 1/6/2011 10:42 AM, Paul wrote:
> "Bart van Ingen Schenau" <bart@ingen.ddns.info> wrote in message
> news:666db0c3-1a98-4997-9880-2e59750bbd33@z19g2000yqb.googlegroups.com...
> On Jan 6, 12:27 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>> A member functions is part of an object. true or false?

>
>> False.

>
> You are entitled to your opinion.


What does it have to do with opinions? A member function is a kind of
function. A function isn't an object, and as such cannot be a part of
another object.

V
--
I do not respond to top-posted replies, please don't ask

Paul 01-06-2011 04:25 PM

Re: member functions
 

"Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
news:ig4orp$2n2$1@news.eternal-september.org...
> On 1/6/2011 10:42 AM, Paul wrote:
>> "Bart van Ingen Schenau" <bart@ingen.ddns.info> wrote in message
>> news:666db0c3-1a98-4997-9880-2e59750bbd33@z19g2000yqb.googlegroups.com...
>> On Jan 6, 12:27 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>> A member functions is part of an object. true or false?

>>
>>> False.

>>
>> You are entitled to your opinion.

>
> What does it have to do with opinions? A member function is a kind of
> function. A function isn't an object, and as such cannot be a part of
> another object.
>



You refer to functions as objects yet in the same statement you clearly
state a function is not an object.
What you have stated here is nothing more than some twisted double negative

You also seem to have no regard for opinions


Victor Bazarov 01-06-2011 05:03 PM

Re: member functions
 
On 1/6/2011 11:25 AM, Paul wrote:
>
> "Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
> news:ig4orp$2n2$1@news.eternal-september.org...
>> On 1/6/2011 10:42 AM, Paul wrote:
>>> "Bart van Ingen Schenau" <bart@ingen.ddns.info> wrote in message
>>> news:666db0c3-1a98-4997-9880-2e59750bbd33@z19g2000yqb.googlegroups.com...
>>>
>>> On Jan 6, 12:27 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>> A member functions is part of an object. true or false?
>>>
>>>> False.
>>>
>>> You are entitled to your opinion.

>>
>> What does it have to do with opinions? A member function is a kind of
>> function. A function isn't an object, and as such cannot be a part of
>> another object.
>>

>
>
> You refer to functions as objects yet in the same statement you clearly

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Where?

> state a function is not an object.


It is not, and I am basically repeating what the Standard says (see the
first Note in [intro.object/1]).

> What you have stated here is nothing more than some twisted double negative


Is English a language you've mastered? Perhaps I ought to use shorter
sentences? Let's try it again:

Only an object can be a part of another object. A function is NOT an
object. Hence a function cannot be a part of an object. There is
nothing in this that is an opinion. Those are just two facts and a
corollary.

> You also seem to have no regard for opinions


That's inconsequential to the matter at hand.

V
--
I do not respond to top-posted replies, please don't ask

Ulrich Eckhardt 01-06-2011 05:41 PM

Re: member functions
 
Paul wrote:
> A member functions is part of an object. true or false?


In the context of the C++ object model, you have been given the answer
over and over.

Why are you asking again? Just read the existing answers.

> To me a member funtion is part of an object by definition.


By what definition?


Ulrich Eckhardt 01-06-2011 05:43 PM

Re: member functions
 
Paul wrote:
> "Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
> news:ig4orp$2n2$1@news.eternal-september.org...
>> What does it have to do with opinions? A member function is a kind of
>> function. A function isn't an object, and as such cannot be a part of
>> another object.

>
> You refer to functions as objects yet in the same statement you clearly
> state a function is not an object.


He does no such thing.


> You also seem to have no regard for opinions


Well, I wouldn't say so, he just doesn't have any for your opinions.

Ney André de Mello Zunino 01-06-2011 05:47 PM

Re: member functions
 
Em 06/01/2011 15:03, Victor Bazarov escreveu:
> On 1/6/2011 11:25 AM, Paul wrote:
>>
>> You refer to functions as objects yet in the same statement you clearly

> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Where?


Judging from what the OP has shown so far, I wouldn't be surprised if he
derived (no pun intended) that conclusion from your sentence: "A member
function is a kind of function." IOW, you must only use the construction
"is a kinf of" to refer to objects in the OO sense; nowhere else. <g>

Haven't all this gone too far? Paul is surely entitled to his opinion. I
just think that his apparent goal of pushing his understanding of the
relationship between member functions and objects in the context of C++
will lead him nowhere.

Regards,

--
Ney André de Mello Zunino

Paul 01-06-2011 05:52 PM

Re: member functions
 

"Ulrich Eckhardt" <doomster@knuut.de> wrote in message
news:8omd9rFsqqU3@mid.uni-berlin.de...
> Paul wrote:
>> "Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
>> news:ig4orp$2n2$1@news.eternal-september.org...
>>> What does it have to do with opinions? A member function is a kind of
>>> function. A function isn't an object, and as such cannot be a part of
>>> another object.

>>
>> You refer to functions as objects yet in the same statement you clearly
>> state a function is not an object.

>
> He does no such thing.
>
>

He compares a function to 'another object'.

Are you people for real.



All times are GMT. The time now is 01:56 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.