So, for example, in an object-oriented language, when a function of an object is referenced as an object (freeing it from having any knowledge of its enclosing host object) the new function object can be passed, stored, and called at a later time.
As of [[C++11|the 2011 revision]], the C++ language also supports closures, which are a type of function object constructed automatically from a special language construct called "lambda-expression".
The class print is a function object which writes data to the standard output stream. When called, the overloaded operator()() operator receives a pointer to the beginning and end of the data as identified by the rules executing the particular action.
Actions are implemented as functions or function objects. The latter are beneficial if the action should be initialized or maintain state information between repeated executions. The above example implements the action as a function object.
Now you understand a lambda is a function object; you may expect lambdas to store arbitrary values, not just to capture the values from their local scope. Fortunately, in C++14, lambdas can introduce new variables in its body by the mean of capturing with an initializer4.
Django offers another way of specifying the view function for a particular pattern in the URLconf: you can pass a string containing the module name and function name rather than the function object itself. Continuing the ongoing example
As explained in Chapter 3, each entry in the URLconf includes its associated view function, passed directly as a function object. This means its necessary to import the view functions at the top of the module.
It must first be retrieved into a Method or Proc object to be used as first-class syntax for calling such a function object differs from calling regular methods.
Creates a function object that returns the complement of the result of the function object it holds (function template) [edit]
创建函数对象,它返回其所保有的函数对象结果的逻辑补 (函数模板 ) [ 编辑]
Potentially sensitive or inappropriate content
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.
No results found for this meaning.
Synonyms and analogies of "function object" in English