Created
October 15, 2014 20:02
-
-
Save commel/10ee7332cc19db87891b to your computer and use it in GitHub Desktop.
Partial implemented interface in C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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