diff options
Diffstat (limited to 'libraries/logic/DefaultVariable.h')
-rw-r--r-- | libraries/logic/DefaultVariable.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/libraries/logic/DefaultVariable.h b/libraries/logic/DefaultVariable.h deleted file mode 100644 index 38d7ecc2..00000000 --- a/libraries/logic/DefaultVariable.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -template <typename T> -class DefaultVariable -{ -public: - DefaultVariable(const T & value) - { - defaultValue = value; - } - DefaultVariable<T> & operator =(const T & value) - { - currentValue = value; - is_default = currentValue == defaultValue; - is_explicit = true; - return *this; - } - operator const T &() const - { - return is_default ? defaultValue : currentValue; - } - bool isDefault() const - { - return is_default; - } - bool isExplicit() const - { - return is_explicit; - } -private: - T currentValue; - T defaultValue; - bool is_default = true; - bool is_explicit = false; -}; |