C++ or Python
Dan Stromberg
dstromberglists at gmail.com
Sun Jun 29 14:26:29 EDT 2008
On Sun, 29 Jun 2008 11:20:45 +0200, Sebastian \"lunar\" Wiesner wrote:
> Dan Stromberg <dstromberglists at gmail.com>:
>
>> things like passing a method as a function parameter is a no-brainer
>> (requires extra syntax in java because of the cautious type system -
>> not sure about C++).
>
> C++ has function pointers and functors, therefore this is not really an
> issue with C++.
Based on http://en.wikipedia.org/wiki/
Function_object#Functors_in_C_and_C.2B.2B it looks like there's no
special syntax in the language core, but programs needing to pass an
object as though it were a function (for example) do need to add some
extra lines of code for each object needing such treatment.
More information about the Python-list
mailing list