From 1476226011776443424
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fb1a92fa405c930c
X-Google-Attributes: gidf78e5,public
From: stanley@West.Sun.COM (Stanley Friesen [Contractor])
Subject: Re: nested functions
Date: 1999/06/09
Message-ID: <7jm9o6$i67@abyss.West.Sun.COM>#1/1
X-Deja-AN: 487624831
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7jd4c5$nup$1@nnrp1.deja.com> <7jfkcr$na6$1@engnews1.eng.sun.com> <7jjq0g$tlu$1@nnrp1.deja.com>
X-Original-Date: 9 Jun 1999 17:54:14 GMT
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 928958472 6986 128.250.29.16 (9 Jun 1999 20:01:12 GMT)
Organization: SunSoft South, Los Angeles, CA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN17H7+EDnX0m9pzZAQGEqQF/UMB+GnWTJs0RnNss8JE3K9bSgo3h+hRl UujfCc7NseeSMJQxn0/xdNO+R24CSgpH =p441
NNTP-Posting-Date: 9 Jun 1999 20:01:12 GMT
Newsgroups: comp.std.c++

In article <7jjq0g$tlu$1@nnrp1.deja.com>,
Andrei Alexandrescu  <andrewalex@hotmail.com> wrote:
>On the other hand, with C++ the situation changed quite radically.
>Templates are in, and they (and the way the standard library uses
>them) enable working with local functions in a natural, elegant way.

While this is so, I see local functions as providing too much potential
for abuse and obscured code, for too little added power for me to want
to see the feature.
>
>With all due respect, the fact that there are local classes but no local
>functions is to me an over-OOPism of the commitee members. Andrew's
>spartan answer is not relieving. Okay, the proposal was rejected, but
>the question is: was it rejected for a good reason? If yes, what's the
>good reason - and what's the one for adding local classes? Furthermore,
>why does one reason not apply to the other case? Etcaetera.

Actually, I have found little good use for local classes either.

Most cases I have seen where one might want this are better handled as
embedded classes or as classes in an anonymous namespace.

I would not really be too upset if local classes were eliminated from
the language.
>
>As it is now, the local classes feature is kind of like the preprocessor
>is: a nice idea, but implemented in a way that's deceptively close to
>usefulness.

I am not convinced that local classes are really that nice an idea.
---
[ 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              ]



