What is the difference between std::function and std::mem_fn
I am having trouble figuring out the difference between the two function wrappers std::function and std::mem_fn . From the description, it seems to me that std::function does everything std::mem_fn does and more. In which instance would one use std::mem_fn over std::function ? You can't really compare std::function with std::mem_fn . The former is a class template whose type you specify, and the latter is a function template with unspecified return type. There really isn't a situation in which you'd actually consider one versus the other. A better comparison might be between mem_fn and std: