From 8557347210587883840
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ec3337d9f2b7ae74
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1993-12-04 21:03:12 PST
Newsgroups: comp.std.c++
Path: gmd.de!newsserver.jvnc.net!yale.edu!spool.mu.edu!sgiblab!munnari.oz.au!metro!news
From: maxtal@physics.su.OZ.AU (John Max Skaller)
Subject: Re: Is a member function a function? (was Re: Q: va_end in C++?)
Message-ID: <CHJnn8.165@ucc.su.OZ.AU>
Sender: news@ucc.su.OZ.AU
Nntp-Posting-Host: physics.su.oz.au
Organization: School of Physics, University of Sydney, Australia
References: <CGvLEo.wD@ses.com> <rfgCH85x3.Hs@netcom.com> <CHFBxp.5M4@ses.com>
Date: Sun, 5 Dec 1993 04:11:32 GMT
Lines: 67

In article <CHFBxp.5M4@ses.com> jamshid@castro.uucp (Jamshid Afshar) writes:
>In article <rfgCH85x3.Hs@netcom.com>,
>Ronald F. Guilmette <rfg@netcom.com> wrote:
>>>The term "function" includes member functions.
>>
>>Jamshid, I do not share your view in this case.
>>
>>In general, it appears to me that both the ARM and current X3J16 working
>>paper are very explicit in specifying whether any given rule applies to
>>either "functions" or "member functions".  I do not think that the latter
>>is considered a subset of the former.  Rather, the ARM and the X3J16 WP
>>seem (in general) to treat these as two entirely disjoint sets.
>
>Can you provide examples where the ARM/WP treat functions and member
>functions as disjoint sets?  

	Oh, come on. Taking the address of a global function
yields a function pointer, taking the address of a non-static
member function yields a pointer to member, and THEY are completely
and categorically distinct in the ARM.

	Its quite clear to me that there are two distinct types
of functions: global functions and member functions.

I'm told the committee decided that a member function was a
function. 

Its possible to decide that a member function is not like an
ordinary function, at least until its given an extra argument
(for the this pointer).

It was possible to decide that a member function is like an
ordinary function in that in context it is callable just the
same way.

However, the committee DID make a decision that distinguishes
ordinary functions from members even more strongly, namely
to all const qualified returns to control overloading
of member functions BUT NOT ORDINARY ONES.

	class X {
		void operator[](int); // #1
		void operator[](int)const; // #2
	};
	class Y {
		friend void operator[](Y&, int); // #3
		friend void operator[](Y const&, int); // #4
	};

	X x();
	const X cx();
	Y y();
	const Y cy();

	x()[1]; // calls #1, nonconst version
	cx()[1]; // calls #2, const version

	y()[1]; // calls #4, const version
	cy()[1]; // calls #4, const version

I find this distinction disturbing.

--
        JOHN (MAX) SKALLER,         INTERNET:maxtal@suphys.physics.su.oz.au
	Maxtal Pty Ltd,		    CSERVE:10236.1703 
        6 MacKay St ASHFIELD,	    Mem: SA IT/9/22,SC22/WG21 
        NSW 2131, AUSTRALIA	    


