diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-02-28 17:25:57 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-02-28 17:25:57 +0700 |
commit | 67bb27e9f5beec4d8ca0a6c29f045d5f23d6f40f (patch) | |
tree | b677228d71b638dd6e423b037311ef0913ba66e7 /cpptour/enumcls.cc | |
parent | ee9b8fc921f48dc893808e1c9dbfbef321aa362c (diff) | |
download | cp-67bb27e9f5beec4d8ca0a6c29f045d5f23d6f40f.tar.gz |
[lang] Reorganize language learning archive
Diffstat (limited to 'cpptour/enumcls.cc')
-rw-r--r-- | cpptour/enumcls.cc | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/cpptour/enumcls.cc b/cpptour/enumcls.cc deleted file mode 100644 index 2340f65..0000000 --- a/cpptour/enumcls.cc +++ /dev/null @@ -1,28 +0,0 @@ -#include <iostream> - -using namespace std; - -enum class Color { red, blue, green }; -enum class TraficLight { green, yellow, red }; - -TraficLight& operator++ (TraficLight& t) -{ - switch (t) - { - case TraficLight::green: - return t = TraficLight::yellow; - case TraficLight::yellow: - return t = TraficLight::red; - case TraficLight::red: - return t = TraficLight::green; - } -} - -int -main () -{ - Color col = Color::red; - TraficLight light = TraficLight::red; - TraficLight nxt = ++light; - // ugh now we test if it compiles? just wanna build some muscle memory -} |