Skip to content

Instantly share code, notes, and snippets.

@commel
Created October 15, 2014 20:02
Show Gist options
  • Save commel/10ee7332cc19db87891b to your computer and use it in GitHub Desktop.
Save commel/10ee7332cc19db87891b to your computer and use it in GitHub Desktop.
Partial implemented interface in C++
#include <iostream>
using namespace std;
class Base {
virtual void one() const = 0;
virtual void two() const = 0;
};
class First : public Base {
public:
void one() const override {
cout << "one" << endl;
}
};
class Second : public First {
public:
void two() const override {
cout << "two" << endl;
};
};
int main() {
Second s;
s.one();
s.two();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment