From -5850366488180612711 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f78e5,a69618ea97f65037 X-Google-Attributes: gidf78e5,public From: kanze@gabi-soft.fr (J. Kanze) Subject: Re: nested functions Date: 1998/04/20 Message-ID: #1/1 X-Deja-AN: 346891539 Approved: stephen.clamage@sun.com (comp.std.c++) References: <6hac23$8lb$1@news2.isdnet.net> Originator: clamage@taumet X-UID: 0000000001 X-Status: $$$T Organization: GABI Software, S�rl. Newsgroups: comp.std.c++ "Lo�c Tr�gan" writes: |> 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++ ? Whether they are a good thing or not is a subject of discussion -- I happen to like them, although I think that there are even better solutions in the context of C++. Good thing or not, they are not allowed in either C or C++. During the recent revision of the C standard, I think that they were actually considered and voted down. Of course, this might be partially because of difficulties in introducing them into the language as it exists today, without breaking anything else, and without imposing additional cost on people who don't use them. If your compiler does not issue a diagnostic in the above program, it is either seriously broken, or it is not a C or C++ compiler. (Gcc requires special compiler options, for example, to compile C; be default, it compiles a language which is only somewhat similar to C. G++ is somewhat better with regards to C++, but you still need special options to get C++.) -- James Kanze +33 (0)1 39 23 84 71 mailto: kanze@gabi-soft.fr GABI Software, 22 rue Jacques-Lemercier, 78000 Versailles, France Conseils en informatique orient�e objet -- -- Beratung in objektorientierter Datenverarbeitung [ 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 ]