Some versions of G++ complained about being unable to decide between the const and non-const functions. Rewriting without the use of the deprecated std::mem_fun is the simplest fix.