[Nottingham] C++ Programming

Alex Tibbles alex_tibbles at yahoo.co.uk
Thu Oct 16 11:36:58 BST 2003


 --- Jim Driscoll <j at rjimlad.org> wrote: > 
> On Wednesday, October 15, 2003, at 07:08 PM, Martin
> wrote:
> 
> >
> > And in any case, what's wrong with function
> pointers so long as you 
> > keep them typed?
> >
> >
> 
> "Wild" (which is to say, a pointer with an undefined
> value) function 
> pointers are deeply evil. Still, I don't know of any
> really better way 
> to do an "array" of functions.

well, the OP didn't seem to want an array - more a
std::map which can have empty emtries (for the case
when a key has not been registered - unfortunately
there is a gotcha in operator[] in std::map - it
inserts a default value if there isn't one. so it
couldn't be used exactly like an array - an existence
test would be required first).

> I doubt C++ has any giggery-pokery for this kind of
> thing, as its 
> supposed to be all about OOP...
 (see earlier post about functions)

alex

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk



More information about the Nottingham mailing list