aboutsummaryrefslogtreecommitdiff
path: root/build/utility
diff options
context:
space:
mode:
Diffstat (limited to 'build/utility')
-rw-r--r--build/utility13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/utility b/build/utility
index bef6335..bcbf834 100644
--- a/build/utility
+++ b/build/utility
@@ -5,8 +5,11 @@
#ifndef BUILD_UTILITY
#define BUILD_UTILITY
+#include <string>
+#include <unordered_set>
#include <cstring> // strcmp
+
namespace build
{
struct compare_c_string
@@ -22,6 +25,16 @@ namespace build
template <typename P>
bool operator() (const P& x, const P& y) const {return *x < *y;}
};
+
+ // Pools (@@ perhaps move into a separate header).
+ //
+ struct string_pool: std::unordered_set<std::string>
+ {
+ const std::string&
+ find (const char* s) {return *emplace (s).first;}
+ };
+
+ extern string_pool extension_pool;
}
#endif // BUILD_UTILITY