From -7438973473319289292
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/10
Message-ID: <37dd56e1.565652003@nntp.ix.netcom.com>#1/1
X-Deja-AN: 487888485
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7jd4c5$nup$1@nnrp1.deja.com> <7jjjr6$r02$1@nnrp1.deja.com> <7jma5c$i85@abyss.West.Sun.COM>
X-Original-Date: Thu, 10 Jun 1999 08:10:35 GMT
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 929018479 17424 128.250.29.16 (10 Jun 1999 12:41:19 GMT)
Organization: Netcom
X-NETCOM-Date: Thu Jun 10  3:02:53 AM CDT 1999
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN1+yRuEDnX0m9pzZAQE9MQF9FREUmxOykTWjwo4/PVyxeBAyDH6iW/J5 kAzjcx8GPaeZdGZm0uTq4udGf1UFTVbw =2xlW
Mime-Version: 1.0
NNTP-Posting-Date: 10 Jun 1999 12:41:19 GMT
NNTP-Posting-User: source
Newsgroups: comp.std.c++

On 9 Jun 1999 18:09:53 GMT in comp.std.c++, stanley@west.sun.com
(Stanley Friesen [Contractor]) wrote:
>In article <7jjjr6$r02$1@nnrp1.deja.com>,  <wmm@fastdial.net> wrote:
>>In article <7jd4c5$nup$1@nnrp1.deja.com>,
>>1) Runtime overhead.  The function calling sequence has to be
>>modified to maintain a display pointer or the like. ...
>
>Why do local functions have to have the same calling sequence as non-local
>functions?  Given the C++ requirement for all functions to be declared
>prior to a call, the compiler can always tell if a call is to a namespace
>scope funcion or to a local one.

Also, a local function can only be called from within the context of a
function that knows about it.  Returning a pointer to a local function
would be undefined, just like returning a pointer to an auto variable.
Code elsewhere needs no overhead added to the calling sequence.

I want it.

But when all is said and done, I don't need it.  You can do everything
AFAIK by passing explicit argements, and other techniques mentioned on
this thread.  You just lose structure.
---
[ 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              ]



