#include<boost/lexical_cast.hpp> #include<vector> using namespace std; using namespace boost; class Widget { string name; public: Widget(int x) { name=lexical_cast<string>(x); } ~Widget() { } void ShowValue() { cout<<name<<endl; } }; int main() { vector<Widget*> vec; for (int i=100;i<200;i++) { vec.push_back(new Widget(i)); } for_each(vec.begin(),vec.end(),mem_fun(&Widget::ShowValue)); return 0; }