From 6107167085809412884
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109fba,ac06fef48c3c04df
X-Google-Attributes: gid109fba,public
X-Google-Thread: f78e5,ac06fef48c3c04df
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1995-01-27 06:01:59 PST
Newsgroups: comp.lang.c++,comp.std.c++
Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!uwm.edu!news.moneng.mei.com!howland.reston.ans.net!news.sprintlink.net!pipex!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: friends and local classes
Message-ID: <9502801.16190@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (-)
Organization: Computer Science, University of Melbourne, Australia
References: <FENSTER.95Jan24182929@ground.cs.columbia.edu> <3g5qc6$16p@news.cc.utah.edu> <3g5rei$dl8@news.panix.com>
Date: Fri, 27 Jan 1995 14:01:59 GMT
Lines: 19
Xref: nntp.gmd.de comp.lang.c++:88225 comp.std.c++:11266

swillden@fcom.cc.utah.edu (Shawn Willden) wrote:
>>
>> Just make a local class with a static function if you need a local function.
>> 
>> void functionWithLocalFunction() {
>>     struct Local {
>> 	int static compare(const void* a, const void* b) { ... };
>>     };
>> 
>>     //...
>>     qsort(array, sizeof(array)/sizeof(array[0]), sizeof(array),
>>           &Local::compare);
>>     }

If it's that easy, why can't the compiler do it automatically?

-- 
Fergus Henderson - fjh@munta.cs.mu.oz.au
all [L] (programming_language(L), L \= "Mercury") => better("Mercury", L) ;-)


