home | login | register | DMCA | contacts | help | donate |      

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
А Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Э Ю Я


my bookshelf | genres | recommend | rating of books | rating of authors | reviews | new | форум | collections | читалки | авторам | add

Loading...


Example

struct B {

 virtual void print() = 0;

};


struct D1 : public B {

 void print() { cout << "I'm a D1" << endl; }

};


struct D2 : public B {

 void print() { cout << "I'm a D2" << endl; }

};


int main() {

 vector V;

 V.push_back(D1());

 V.push_back(D1());

 for_each(V.begin(), V.end(), mem_fun_ref(B::print));

}


Description | Standard Template Library Programmer`s Guide | Definition







Loading...