summaryrefslogtreecommitdiff
path: root/src/utils/optional_bool.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/optional_bool.hpp')
-rw-r--r--src/utils/optional_bool.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/utils/optional_bool.hpp b/src/utils/optional_bool.hpp
new file mode 100644
index 0000000..824e76d
--- /dev/null
+++ b/src/utils/optional_bool.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <string>
+
+struct OptionalBool
+{
+ OptionalBool() = default;
+
+ OptionalBool(bool value):
+ is_set(true), value(value) {}
+
+ void set_value(bool value)
+ {
+ this->is_set = true;
+ this->value = value;
+ }
+
+ void unset()
+ {
+ this->is_set = false;
+ }
+
+ bool is_set{false};
+ bool value{false};
+};