A callable object, in computer programming, is any object that can be called like a function.
Contents
In C++
std::function
is a template class that can hold any callable object that matches its signature.
In C#
In PHP
PHP 5.3+ has first-class functions that can be used e.g. as parameter to the usort() function:
It is also possible in PHP 5.3+ to make objects invokable by adding a magic __invoke() method to their class:
In Python
In Python any object with a __call__()
method can be called using function-call syntax.
References
Callable object Wikipedia(Text) CC BY-SA