You're viewing a comment by Michel Jansen and its responses.

May 17, 2010, 15:17

Thanks for your explanation. I've recently been programming a lot in Ruby, where you have Procs, Blocks and lambda closures and while working with C++ I really missed the dynamics of these concepts. I think the biggest lack of C++ is that it does not support anonymous function objects. You always have to define a class and override the operator().

C++'s functors are, in my opinion, also not powerful enough for full object oriented use. It is not easy to create a functor for a method call on an object. In Ruby this is solved using Method Objects:

method_object = Person.method(:name)
...
name = method_object.call

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "cdrom_219": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.