fork download
  1. #include <iostream>
  2.  
  3. struct PureVirtual {
  4. virtual void Function() = 0;
  5. };
  6.  
  7. struct FunctionImpl {
  8. virtual void Function() {
  9. std::cout << "FunctionImpl::Function()" << std::endl;
  10. }
  11. };
  12.  
  13. struct NonPureVirtual : public FunctionImpl, public PureVirtual {
  14. virtual void Function() override {
  15. return FunctionImpl::Function();
  16. }
  17. };
  18.  
  19. int main() {
  20. NonPureVirtual c;
  21. c.Function();
  22. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
FunctionImpl::Function()