A functor, or function object, is a class in C++ with the () operator overloaded. Functors are used a lot in the standard library to do custom comparisons. They're used in place of function pointers because sometimes you need to store a value or remember something (ie. put the functor into a special 'state' for whatever purpose), a functor can do this, a function pointer can't (without messing with global variables).
class over5 { // this class is the functor
bool operator() (int x) {
return x > 5;
}
};
std::list<int> L;
... // put a bunch of ints onto the list
over5 o5;
std::find_if(L.begin(), L.end(), o5);
// o5 will have its overloaded () operator called to check if the element in L is over 5.
bool operator() (int x) {
return x > 5;
}
};
std::list<int> L;
... // put a bunch of ints onto the list
over5 o5;
std::find_if(L.begin(), L.end(), o5);
// o5 will have its overloaded () operator called to check if the element in L is over 5.
by Sam Johnston July 23, 2005
Get the functor mug.HGTV Season 4 Design Star Jason Champion made this word popular during taping of season 4 April 2009. Jason brought Southern to LaLa land and made it an every day word.
by triston fall August 24, 2009
Get the Functionable mug.Related Words
funch
• funcle
• function
• funching
• Funcomfortable
• func
• funce
• funck
• functionable
• funchy
A functioning homosexual is a gay person who has not given
thier life over to the drama associated with their sexual orientation.
A homosexual who can pass as straight when the need arises.
Someone like Will on Will and Grace.
thier life over to the drama associated with their sexual orientation.
A homosexual who can pass as straight when the need arises.
Someone like Will on Will and Grace.
Gay Dude 1: It's amazing how calm Bob was when Brucie had
his meltdown at the GLT meeting last night.
Gay Dude 2: Bob is very good at keeping it together, he is quite
the functioning homosexual.
his meltdown at the GLT meeting last night.
Gay Dude 2: Bob is very good at keeping it together, he is quite
the functioning homosexual.
by jsd9632 December 18, 2011
Get the functioning homosexual mug.This lady came to me in a dream and said, "Funch. It's like lunch, but it's fun, cause it moves."
Zee's funch was more than he bargained for when it started squirming.
Zee's funch was more than he bargained for when it started squirming.
by Archer Sauce April 11, 2007
Get the funch mug.by ihavenothingtodoinlife May 23, 2022
Get the Functional neurological disorder mug.A more entertaining way to accomplish a task that could alternatively be reached in a shorter or quicker way.
Joe wanted to take the highway shortcut to the pub, but we decided to take the ferry funcut instead.
by mdhare January 3, 2009
Get the funcut mug.That looks like a functivity.
by Skylar Fun May 2, 2008
Get the functivity mug.