Skip to content

Instantly share code, notes, and snippets.

@AlexanderBrevig
Created June 7, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderBrevig/6e584541b8093ee21da975d90db94cdc to your computer and use it in GitHub Desktop.
Save AlexanderBrevig/6e584541b8093ee21da975d90db94cdc to your computer and use it in GitHub Desktop.
class ONOFF_ {}; typedef const ONOFF_ * const ONOFF;
class BLINKSPEED_ {}; typedef const BLINKSPEED_ * const BLINKSPEED;
class ON_ : public ONOFF_ {}; const ON_ on_; const ON_ * const ON = &on_;
class SLOW_ : public BLINKSPEED_ {}; const SLOW_ slow_; const SLOW_ * const SLOW = &slow_;
class OFF_ : public ONOFF_, public BLINKSPEED_ {}; const OFF_ off_; const OFF_ * const OFF = &off_;
class FAST_ : public BLINKSPEED_ {}; const FAST_ fast_; const FAST_ * const FAST = &fast_;
class MED_ : public BLINKSPEED_ {}; const MED_ med_; const MED_ * const MED = &med_;
/* void setFan(ONOFF onOrOff) {}*/// would only accept either ON or OFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment