I wonder if this could be done with a pointer-to-member function, but that's probably idle speculation.