I just wanted to be sure everyone knows the STL-speak for these terms:
1) Generator.
A function that takes no arguments.
2) unary function
A function that takes one argument.
If this function returns a bool is is called a
predicate.
3) binary function
A function that takes two arguments.
If this function returns a bool it is called a
binary predicate.
So you have to be careful reading STL documentation. All you will see, for example, is the word predicate. It is assumed you know this to be a unary function that returns a bool.
Also be aware that there are
classes named unary_function and binary_function that are to help you in writing adaptable functors and function adapters:
- template<class T>
-
class Y : public unary_function<T,T>
-
{
-
-
};
-
-
template<class T>
-
class Z : public binary_function<T,T,T>
-
{
-
-
};
These adaprtable functors and function adapters are needed since STL supports only zero, one or two arguments. If you need more, then you write an adaptable functor.