int &(vector<int>::*extract)(vector<int>::size_type);是什么意思
程序代码:
[code] #include <iostream> #include <vector> #include <map> #include <iterator> #include <algorithm> #include <hash_set> #include <functional> using namespace std; class Base { public: virtual void print()=0; }; class B1: public Base { public: void print() { cout<<" this is B1"<<endl; } }; class B2: public Base { public: void print() { cout<<" this is B2"<<endl; } }; class Op { public: virtual double eval(double)=0; }; class square:public Op { public: double eval(double x) { return x*x; } }; class Negate:public Op { public: double eval(double x) { return -x; } }; int main() { //mem_fun1_ref_t vector<int> v1{1,1,1,1,1}; vector<int> v2{2,2,2,2,2}; vector<int> v3{3,3,3,3,3}; vector<vector<int> > v; v.push_back(v1); v.push_back(v2); v.push_back(v3); vector<int> v4{1,2,3}; int &(vector<int>::*extract)(vector<int>::size_type);//1 extract=&vector<int>::operator[];//2 transform(v.begin(),v.end(),v4.begin(),ostream_iterator<int>(cout," "),mem_fun_ref(extract));//3 return 0; }[/code]
上边标注的1 2 3 这三行代码什么意思??求指教