Created
July 22, 2014 01:00
-
-
Save jerstlouis/e9846f70664116564f45 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Engine | |
{ | |
virtual void ::spec(any_object object); | |
} | |
class Wheel | |
{ | |
virtual void ::nos(any_object object); | |
} | |
class CarWheel : Wheel | |
{ | |
void spec(Car car) | |
{ | |
} | |
} | |
class CarEngine : Engine | |
{ | |
void nos(Car car) | |
{ | |
} | |
} | |
class Car | |
{ | |
subclass(Engine) engine; engine = class(CarEngine); | |
subclass(Wheel) wheel; wheel = class(CarWheel); | |
} | |
void SomethingThatDealsWithAnEngine(subclass(Engine) engineClass, any_object i) | |
{ | |
engineClass.spec(i); | |
} | |
void Test() | |
{ | |
Car car { }; | |
SomethingThatDealsWithAnEngine(car.engine, car); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment