I had a case today where I needed a functor that was a bound member
function. Basically:
class MyClass {
...bug free code omitted...
void PrintMe( int x ) {
printf( "%d\n", x );
}
void A_Function() {
...
std::vector<int> myList;
...
std::for_each(
myList.begin(),
myList.end(),
bound_mem_fun( *this, PrintMe ); // bound_mem_fun is made up
);
}
Am I correct in my conclusion that there is no such adapter in the standard
library? It looks like there is one in Boost, and it only took about 8
lines of code to implement it, but I don't want to reimplement it if there
is one built in that I missed.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.