Browse Source

cmListFileContext: Implement EqualityComparable.

Stephen Kelly 10 years ago
parent
commit
9645cba3bf
2 changed files with 12 additions and 0 deletions
  1. 10 0
      Source/cmListFileCache.cxx
  2. 2 0
      Source/cmListFileCache.h

+ 10 - 0
Source/cmListFileCache.cxx

@@ -440,3 +440,13 @@ bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs)
     }
   return lhs.FilePath < rhs.FilePath;
 }
+
+bool operator==(const cmListFileContext& lhs, const cmListFileContext& rhs)
+{
+  return lhs.Line == rhs.Line && lhs.FilePath == rhs.FilePath;
+}
+
+bool operator!=(const cmListFileContext& lhs, const cmListFileContext& rhs)
+{
+  return !(lhs == rhs);
+}

+ 2 - 0
Source/cmListFileCache.h

@@ -63,6 +63,8 @@ struct cmListFileContext
 
 std::ostream& operator<<(std::ostream&, cmListFileContext const&);
 bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs);
+bool operator==(cmListFileContext const& lhs, cmListFileContext const& rhs);
+bool operator!=(cmListFileContext const& lhs, cmListFileContext const& rhs);
 
 struct cmListFileFunction: public cmListFileContext
 {