From -6659858895599623048
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fb1a92fa405c930c
X-Google-Attributes: gidf78e5,public
From: jpotter@falcon.lhup.edu (John Potter)
Subject: Re: nested functions
Date: 1999/06/23
Message-ID: <amw93.3323$uk.51917@newscene.newscene.com>#1/1
X-Deja-AN: 492912514
Approved: Valentin Bonnard <bonnard@clipper.ens.fr>
References: <7jd4c5$nup$1@nnrp1.deja.com> <7jjjr6$r02$1@nnrp1.deja.com> <7jma5c$i85@abyss.West.Sun.COM> <FD38vK.CC4@research.att.com> <7jrpss$ogk$1@nnrp1.deja.com> <FqA83.38464$wk2.553149@newscene.newscene.com> <010804741210d69CPIMSSMTPU07@email.msn.com>
X-Original-Date: 15 Jun 1999 12:50:05 -0500
Organization: Newscene Public Access Usenet News Service (http://www.newscene.com/)
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUAN3DN1KwEuYhIxRhxAQHy2QH+Jtnq78ppeVOFZ2y7hyasHAuc5tCCk0zB KPRiIsUs0SqBcKMshOdJgnFYvnt6HMLn2vTQSoPkJJJ43dptz0GTbw== =KgYi
Newsgroups: comp.std.c++

"G.B." <gb@web1.ucar.edu> wrote:

: void f3() {
:   void f4(){};
:   p_global(); // run-time error; the local context is different

Undefined behavior covers that.

:   f1::f2(); // compile-time error; same considerations as above

Agree.  No different from f1::x = 5.  You can't look inside of the
function scope.

: > BTW are functions nested within member functions member functions?

: Do we gain anything by making them member functions? I think it would be
: superfluous; local function already has an access to "this" pointer through
: its parent member function.

Everything has access to the "this" pointer via &object.  What are the
rights?  Nestesed class members may not access non-public members of
the enclosing class.  Derived class members may not access private
members of the base class.

: Though it may make sense for pointer
: manipulation since the pointer to member function has a different type, so
: maybe a new keyword can be added to specify member local function.

No new keyword required.  The local function is either a member and
we use pointer to member or it is not and we use normal function
pointer.

All I see is a desire to use Pascal idioms in C++ without the details
of how this will fit into the language.  What are the gains and costs?

John
---
[ 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              ]



