home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!agate!matt
- From: matt@physics2.berkeley.edu (Matt Austern)
- Newsgroups: comp.std.c++
- Subject: Re: C++ already *has* nested functions SO WHAT'S THE BEEF?
- Date: 8 Jan 93 10:04:28
- Organization: Lawrence Berkeley Laboratory (Theoretical Physics Group)
- Lines: 21
- Message-ID: <MATT.93Jan8100428@physics2.berkeley.edu>
- References: <1992Dec21.080952.15309@netcom.com> <harvey.726175866@regina>
- <9300811.3521@mulga.cs.mu.OZ.AU>
- Reply-To: matt@physics.berkeley.edu
- NNTP-Posting-Host: physics2.berkeley.edu
- In-reply-to: fjh@munta.cs.mu.OZ.AU's message of Fri, 8 Jan 1993 00:39:33 GMT
-
- In article <9300811.3521@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
-
- > The classic
- > sort of example where nested functions are useful is
-
- [Example of passing a function pointer to qsort deleted]
-
- > Because the interface to qsort() is fixed, the alternative is to use a rather
- > ugly hack using global variables (well, ok, you can make them file-scope
- > static variables rather than real global variables).
-
- Correct; that's just where nested function would be nice.
-
- And note that encapsulating compare() in some class is not a solution:
- qsort expects its argument to be a function pointer, not a member
- function pointer.
- --
- Matthew Austern Just keep yelling until you attract a
- (510) 644-2618 crowd, then a constituency, a movement, a
- austern@lbl.bitnet faction, an army! If you don't have any
- matt@physics.berkeley.edu solutions, become a part of the problem!
-