From -7476168773139951320
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fb1a92fa405c930c
X-Google-Attributes: gidf78e5,public
From: source@netcom.com (David Harmon)
Subject: Re: nested functions
Date: 1999/06/11
Message-ID: <37fc8bd2.644752685@nntp.ix.netcom.com>#1/1
X-Deja-AN: 488437013
X-NNTP-Posting-Host: netcom9.netcom.com
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7jd4c5$nup$1@nnrp1.deja.com> <7jjjr6$r02$1@nnrp1.deja.com> <7jma5c$i85@abyss.West.Sun.COM> <FD38vK.CC4@research.att.com>
Content-Type: text/plain; charset=us-ascii
Organization: Netcom
X-NETCOM-Date: Fri Jun 11  2:13:37 AM CDT 1999
Mime-Version: 1.0
NNTP-Posting-User: source
Newsgroups: comp.std.c++
Originator: clamage@taumet


On 10 Jun 99 16:20:58 GMT in comp.std.c++, ark@research.att.com
(Andrew Koenig) wrote:

>> Why do local functions have to have the same calling sequence as non-local
>> functions?
>
>Because otherwise, you can't define a variable
>(of type pointer to function) that can potentially
>contain the address of a local function or a non-local
>function.

Just like you can't define a variable that can hold both a pointer
to a member function or a pointer to a non-member function.  A local
function is actually more like a member function than a non-member
function, but instead of 'this' it gets a pointer to an implicit
local context object (AKA display.)



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




