Function object: Difference between revisions

Content deleted Content added
Other meanings: clarifying Haskell with a link
Ljrk (talk | contribs)
Added reference to the application of the category concept of functors in functional programming; clarified that this article applies not to all of computer programming in general, specifically functional programming languages use it differently (i.e., more in line with the mathematical definition)
Tags: Mobile edit Mobile web edit
Line 1:
{{About|the computer programming concept of function objects|functors in mathematics|Functor|the related concept in functional programming|Functor_(functional_programming)}}
{{Refimprove|date=February 2009}}
In [[computer programming]], a '''function object'''{{efn|1=In C++, a '''functionoid''' is an object that has one major method, and a '''functor''' is a special case of a functionoid.<ref>[https://isocpp.org/wiki/faq/pointers-to-members#functor-vs-functionoid What's the difference between a functionoid and a functor?]</ref> They are similar to a function object, ''but not the same''.}} is a construct allowing an [[object (computer science)|object]] to be invoked or called as if it were an ordinary [[subroutine|function]], usually with the same syntax (a function parameter that can also be a function). Function objects are often called '''functors'''.