I realize this is a ludicrous question for something that takes less than 2 seconds to implement. But I vaguely remember reading that one was introduced with the new standard.
I grep'ed VC10's headers and came up with nothing. Can you help? It's bugging me! :)
edit:
On second thought, the new functor I was remembering was probably the unrelated std::default_deleter
.
How about this?
This should work for just about any use.
You could always write a no-op lambda:
[]{}
You was probably thinking about the identity function (std::identity and apparently it's removed in the current draft) that is not the same thing though.
I use this as a drop-in no-op for cases where I expect a functor that does not return any value.
Here is a C++11 variation for arbitrary numbers of parameters: