#include using namespace std; struct base {virtual operator int () {return 1;} Virtual ~ base () {}}; struct derive: public base}; structure operator_ty () {return _ty ( );}}; Int main () {Derive CD; base & cb = cd; int i = cd; cout << i << "/ n"; i = cd.der :: operator int (); cout << I << "/ n"; i = cb; cout << i << "/ n"; double d = cd; cout << d << "/ n";}
VC.NET: 1 1 1 0
GCC: 1 0 1 1
ICC: 0 0 1 0
The template members in the derived class have hidden the function of the same name of the base class (even if it is still not ready) (reserved)