'function' : virtual function cannot be in union 'union'
A union is declared with a virtual function. You can declare a virtual function only in a class or structure.
Possible solutions
The following sample generates C2571:
union A { virtual void func1(); // C2571, remove virtual to resolve the error }; void main() { }