DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

Hacking > ExtensibleStylesheetLanguage > ExtremeProgramming > FastCGI > FastcgiOrModpython > Fighter > Firefox > FluentInterfaces > Flup > ForeignFunctionInterface > ForstGlossar > Fortress > FortressLanguage > FredBrooks > FreiOtto > FunctionObjects > FunctorClear Trail
Main /

Functor

(weitergeleitet von Main.FunctionObjects)

Closures
FunctionPointer
Delegates
FirstClassFunctions


In the C++ StandardTemplateLibrary, a "FunctionObject" is an instance of a class that implements "operator()". As such, its usage is syntactically indistinguishable from a FunctionPointer - a property that lets FunctionObjects and FunctionPointers be used interchangeably in template-based GenericAlgorithms.


A function object, often called a functor, is a computer programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax.[1]


The benefit of using objects instead of FunctionPointers is that the compiler can inline methods with FunctionObjects.

...Wenn sie nicht als Referenz oder Zeiger übergeben werden.

Außerdem können Funktoren einen Zustand (eine Menge von Variablen) kapseln. In dieser Hinsicht funktionieren Funktoren also ähnlich wie Closures, nur dass diese wesentlich weniger Overhead aufweisen.

Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 29.01.2006 23:03 Uhr und seit 7. April 2005 2859 aufgerufen.