Class method pointers… Nothing special really, how’s that a hack? Useful, of course, and good to know, but a hack? That’s more like overloading the comma or something. And wouldn’t a simpler example suffice?
And why do you use new here? You gain nothing but have to remember to call delete (which you don’t), or do you?
Man, I always seem overly critical… Sorry about that. I’m really just trying to help. Anyway, some simpler code showcasing class method pointers:
@Mr.Wonko: Thanks for your example, but code doesn’t work well with in the comments of my wordpress blog. I cleaned up the example source a little bit (I just copied, pasted and edited it on the fly from a current project I’m working on).
Class method pointers… Nothing special really, how’s that a hack? Useful, of course, and good to know, but a hack? That’s more like overloading the comma or something. And wouldn’t a simpler example suffice?
And why do you use new here? You gain nothing but have to remember to call delete (which you don’t), or do you?
Man, I always seem overly critical… Sorry about that. I’m really just trying to help. Anyway, some simpler code showcasing class method pointers:
@Mr.Wonko: Thanks for your example, but code doesn’t work well with in the comments of my wordpress blog. I cleaned up the example source a little bit (I just copied, pasted and edited it on the fly from a current project I’m working on).
Yeah, the example’s much better now. Good luck with your current project.
New function objects are looking better I think:
http://en.wikipedia.org/wiki/C%2B%2B0x#Polymorphic_wrappers_for_function_objects
Old school the using variant looks also kind of neat:
http://en.wikipedia.org/wiki/C%2B%2B0x#Alias_templates