From Jason Turner
Watch on YouTube

Summary

This episode explores the difference between std::mem_fun (deprecated in C++11, removed in C++17) and its replacement std::mem_fn (introduced in C++11). Jason demonstrates how mem_fun was limited to handling only member functions with zero or one argument, and required pointers to objects. In contrast, mem_fn is more versatile, handling any number of arguments, working with both references and pointers (including smart pointers), and supporting both member functions and member object pointers.

Resources

Tags