From 3879418852547742314 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f78e5,a69618ea97f65037 X-Google-Attributes: gidf78e5,public From: "Chuck McCorvey" Subject: Re: nested functions Date: 1998/04/20 Message-ID: <6hda65$mgi$1@camel15.mindspring.com>#1/1 X-Deja-AN: 346891536 Approved: stephen.clamage@sun.com (comp.std.c++) References: <6hac23$8lb$1@news2.isdnet.net> X-Server-Date: 19 Apr 1998 16:53:25 GMT Originator: clamage@taumet X-NNTP-Posting-Host: user-37kb7po.dialup.mindspring.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Creative SolutionWare, Inc. Newsgroups: comp.std.c++ Lo�c Tr�gan wrote in message <6hac23$8lb$1@news2.isdnet.net>... >Are nested functions a good thing ? (of course, i have my opinion...) > >void f() >{ > void InternalA() {} > void InternalB() {} > > InternalA(); > InternalB(); >} > >if YES, why they are nt in the draft ? >if NO, why are they allowed in C and not C++ ? > They can be useful to provide further scoping. However, they are probably (?) less valuable in the presence of classes as in C++. They are NOT allowed for in C or C++. The above code snippet should have caused compiler errors of the form (compiled under VC++ 5.0): test.cpp(3) : error C2601: 'InternalA' : local function definitions are illegal test.cpp(4) : error C2601: 'InternalB' : local function definitions are illegal -- Chuck McCorvey Creative SolutionWare, Inc. [ 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 ]