From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!wns14feed!worldnet.att.net!12.120.4.37!attcg2!attws2!att542!ip.att.net!newsfeed3.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Fri, 11 Mar 2005 15:21:32 -0500 Organization: Earth Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> <2vlYd.104136$Vf.3990994@news000.worldonline.dk> NNTP-Posting-Host: 158.187.64.144 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:9170 comp.lang.c++:45216 comp.realtime:1308 comp.software-eng:4876 Date: 2005-03-11T15:21:32-05:00 List-Id: "Dr. Adrian Wrigley" wrote in message news:pan.2005.03.11.20.06.33.572481@linuxchip.demon.co.uk.uk.uk... > >>> * subprograms inside subprograms. I think it would be great for use > >>> with the STL (i.e., using a local function with std::foreach) > >> > >> Agree strongly. > > > > This will be part of the next standard, I hope. Still i do not believe it to > > be esential for use. > > It is sometimes handy to use the C preprocessor for local functions > That would not work in the example above, i.e., for use as the operation given to STL algorithms. Besides, inline is better for "quick" functions than the preprocessor. The closest thing I've seen in C++ is a locally define class with operator () defines, but: 1) All the compilers I have used usually choke on this, especially with optimization turned on (I don't know what the standard actually says about doing this, though). 2) To access variables from "outer scopes" you would have to send them in through the constructor.