diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/map-key (renamed from build/key-set) | 20 | ||||
-rw-r--r-- | build/target | 2 | ||||
-rw-r--r-- | build/utility | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/build/key-set b/build/map-key index 1d0b532..43cdefe 100644 --- a/build/key-set +++ b/build/map-key @@ -1,9 +1,9 @@ -// file : build/key-set -*- C++ -*- +// file : build/map-key -*- C++ -*- // copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef BUILD_KEY_SET -#define BUILD_KEY_SET +#ifndef BUILD_MAP_KEY +#define BUILD_MAP_KEY #include <utility> // declval() #include <functional> // hash @@ -15,13 +15,13 @@ namespace build // template <typename T> - struct set_key + struct map_key { mutable const T* p; - set_key (const T* v = 0): p (v) {} - bool operator< (const set_key& x) const {return *p < *x.p;} - bool operator== (const set_key& x) const {return *p == *x.p;} + map_key (const T* v = 0): p (v) {} + bool operator< (const map_key& x) const {return *p < *x.p;} + bool operator== (const map_key& x) const {return *p == *x.p;} }; template <typename I> @@ -45,10 +45,10 @@ namespace build namespace std { template <typename T> - struct hash<build::set_key<T>>: hash<T> + struct hash<build::map_key<T>>: hash<T> { size_t - operator() (build::set_key<T> x) const + operator() (build::map_key<T> x) const noexcept (noexcept (declval<hash<T>> () (*x.p))) { return hash<T>::operator() (*x.p); @@ -56,4 +56,4 @@ namespace std }; } -#endif // BUILD_KEY_SET +#endif // BUILD_MAP_KEY diff --git a/build/target b/build/target index 4405104..c961315 100644 --- a/build/target +++ b/build/target @@ -17,7 +17,7 @@ #include <utility> // move() #include <build/path> -#include <build/key-set> +#include <build/map-key> // map_iterator_adapter #include <build/timestamp> #include <build/name> #include <build/operation> diff --git a/build/utility b/build/utility index cd0d8ad..489a5eb 100644 --- a/build/utility +++ b/build/utility @@ -16,7 +16,7 @@ #include <unordered_set> #include <unordered_map> -#include <build/key-set> +#include <build/map-key> #include <build/path> namespace build @@ -211,7 +211,7 @@ namespace build size () const {return static_cast<I> (vec_.size ());} private: - using key_type = set_key<std::string>; + using key_type = map_key<std::string>; using value_type = string_table_element<I, D>; using map_type = std::unordered_map<key_type, value_type>; using traits = string_table_traits<D>; |