Try compiling with online Comeau here - Online Comeau Compiler and see for yourself. The above code will compile fine but just comment the const version and uncomment the non-const version and see. The code will fail to compile.

So, what's the solution? Two possible solutions come to my mind. The first would need you to write a functor whose operator() takes each object of the vector and calls the required member function. The other is to use tr1::bind.

Here are the relevant codes for the two solutions that I talked about.