Functor

Why Trust Techopedia

What Does Functor Mean?

A functor is a type of class in C++ that acts like a function. Experts point out that a functor is created by overloading the operator and passing one argument the way that one would to a conventional function, albeit with different results.

Advertisements

Techopedia Explains Functor

One way to talk about the use of a functor is that functors work as an alternative to global variables in passing more than one argument through a single parameter. Functors may be used in combination with standard template libraries in order to achieve these types of results.

For example, the use of a functor might influence how a developer or engineer adds values to an array through a particular function-oriented workflow. Another way to explain this is that functors can be valuable in terms of "mapping" data through an array approach or other format.

Advertisements

Related Terms

Margaret Rouse
Senior Editor
Margaret Rouse
Senior Editor

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.