aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/types.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/types.hh')
-rw-r--r--src/libutil/types.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh
index 55d02bcf9..9c85fef62 100644
--- a/src/libutil/types.hh
+++ b/src/libutil/types.hh
@@ -4,6 +4,7 @@
#include <list>
#include <set>
+#include <string>
#include <map>
#include <vector>
@@ -33,4 +34,16 @@ struct OnStartup
OnStartup(T && t) { t(); }
};
+/* Wrap bools to prevent string literals (i.e. 'char *') from being
+ cast to a bool in Attr. */
+template<typename T>
+struct Explicit {
+ T t;
+
+ bool operator ==(const Explicit<T> & other) const
+ {
+ return t == other.t;
+ }
+};
+
}