#include <functional>
+#include "tools/gn/label.h"
+
+class Config;
class ParseNode;
+class Target;
// Structure that holds a labeled "thing". This is used for various places
// where we need to store lists of targets or configs. We sometimes populate
}
};
+// Default comparison operators -----------------------------------------------
+//
+// The default hash and comparison operators operate on the label, which should
+// always be valid, whereas the pointer is sometimes null.
+
+template<typename T> inline bool operator==(const LabelPtrPair<T>& a,
+ const LabelPtrPair<T>& b) {
+ return a.label == b.label;
+}
+
+template<typename T> inline bool operator<(const LabelPtrPair<T>& a,
+ const LabelPtrPair<T>& b) {
+ return a.label < b.label;
+}
+
+namespace BASE_HASH_NAMESPACE {
+
+#if defined(COMPILER_GCC)
+template<typename T> struct hash< LabelPtrPair<T> > {
+ std::size_t operator()(const LabelPtrPair<T>& v) const {
+ BASE_HASH_NAMESPACE::hash<Label> h;
+ return h(v.label);
+ }
+};
+#elif defined(COMPILER_MSVC)
+template<typename T>
+inline size_t hash_value(const LabelPtrPair<T>& v) {
+ return BASE_HASH_NAMESPACE::hash_value(v.label);
+}
+#endif // COMPILER...
+
+} // namespace BASE_HASH_NAMESPACE
+
#endif // TOOLS_GN_LABEL_PTR_H_