The following code can be build with VC.net, but it is not compatible with VC6.0, maybe there is something wrong with VC6.0 STL.#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
struct B {
virtual void print() = 0;
};
struct D1 : public B {
void print() { cout << "I'm a D1" << endl; return ; }
};
struct D2 : public B {
void print() { cout << "I'm a D2" << endl;return ; }
};