Skip to content

Instantly share code, notes, and snippets.

@Madsy
Created October 26, 2009 22:44
Show Gist options
  • Save Madsy/219125 to your computer and use it in GitHub Desktop.
Save Madsy/219125 to your computer and use it in GitHub Desktop.
class Base{
public:
Base(){}
void Doit(){
stage1();
stage2();
stage3();
}
private;
void stage1(){ .. }
void stage3(){ ... }
protected:
virtual void stage2() = 0;
};
class Derived : public Base
{
Derived(){}
protected:
void stage2(){ /* ny implementasjon */ }
};
int main()
{
Base* b = new Derived();
b->Doit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment