From 7286645001578577912
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,74637d148a591f02
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-03-27 10:52:21 PST
Return-Path: <devnull@stump.algebra.com>
Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Authentication-Warning: backdraft.briar.org: smap set sender to <nntp-bounce@supernews.net> using -f
From: "Risto Lankinen" <rlankine@hotmail.com>
Newsgroups: comp.std.c++
Subject: Re: Proposal: two real uses for the "auto" keyword
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <tc0acaevpbui9e@corp.supernews.com>
References: <052201c0b4ab$603e8050$0500a8c0@dragonsys.com> <99l3nf$7n0$1@news-int.gatech.edu> <+zJqQ9Afowv6Ews1@ntlworld.com> <3ABF4E68.14646D4E@acm.org>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
X-Complaints-To: newsabuse@supernews.com
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Tue, 27 Mar 2001 12:49:48 CST
Lines: 47
Xref: supernews.google.com comp.std.c++:4029

Hi!

James Dennett <jdennett@acm.org> wrote in message
news:3ABF4E68.14646D4E@acm.org...
> Francis Glassborow wrote:
> >
> > In article <99l3nf$7n0$1@news-int.gatech.edu>, Brian McNamara!
> > <gt5163b@prism.gatech.edu> writes
> > >(As an aside, I am curious why function declarations are even allowed
> > >inside functions.)
> >
> > Almost certainly for compatibility with C.
>
> Would it be sensible to consider deprecating this feature,
> or removing it altogether?  It seems to give no significant
> benefit, and plenty of pain.

The "benefit" is the ability to do overloaded function
selection in a local scope, by utilizing the name hiding
phenomenon.  For example, the program...

void f(int);
void f(bool);

void main()
{
  void f(bool);

  f(1);
  f(false);
}

... changes its behaviour when the declaration inside
the main()'s function block is removed.

Cheers!

 - Risto -



---
[ 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://www.research.att.com/~austern/csc/faq.html                ]



