Matthias wrote:
You should derive the FunctorBase from unary_function<T, bool>.
Why?
Again, because the c++ standard say so ;)
Chapter 20.3 paragraph 5.
"To enable adaptors and other components to manipulate function objects
that take one or two arguments it is required that the function objects
correspondingly provide typedefs argument_type and result_type for
function objects that take one argument and first_argument_type,
second_argument_type, and result_type for function objects that take
two arguments."
You can just provide those typedefs, but that's exactly what
unary_function is for.
And avoid the leading underscore ;).
Why? It's my way of notating a member variable. This way you directly
see which variable is a member and which is not.
I used to use m_ but _ is shorter :)
According to the standard:
"17.4.3.1.2 Global names
1 Certain sets of names and function signatures are always reserved to
the implementation:
- Each name that contains a double underscore (_ _) or begins with an
underscore followed by an uppercase letter (2.11) is reserved to the
implementation for any use.
- Each name that begins with an underscore is reserved to the
implementation for use as a name in the
global namespace.165)"
So, not every name that start with an underscore is restricted, but it
is more easy to avoid leading underscore than to keep in mind all of
above :).
....
Bogdan