Replace use of the deprecated mem_fun function with mem_fn.