forked from qt-creator/qt-creator
Clang: Make ProjectPartId StringCache friendly
Change-Id: I53fdeb87ac67ca2c2c7509bf725566298f3b2963 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -31,6 +31,15 @@ namespace ClangBackEnd {
|
||||
|
||||
class ProjectPartId
|
||||
{
|
||||
template<typename StringType,
|
||||
typename StringViewType,
|
||||
typename IndexType,
|
||||
typename Mutex,
|
||||
typename Compare,
|
||||
Compare compare,
|
||||
typename CacheEntry>
|
||||
friend class StringCache;
|
||||
|
||||
public:
|
||||
constexpr ProjectPartId() = default;
|
||||
|
||||
@@ -47,6 +56,11 @@ public:
|
||||
return first.isValid() && first.projectPathId == second.projectPathId;
|
||||
}
|
||||
|
||||
friend bool operator==(ProjectPartId first, int second)
|
||||
{
|
||||
return first == ProjectPartId{second};
|
||||
}
|
||||
|
||||
friend bool operator!=(ProjectPartId first, ProjectPartId second) { return !(first == second); }
|
||||
|
||||
friend bool operator<(ProjectPartId first, ProjectPartId second)
|
||||
@@ -68,6 +82,10 @@ public:
|
||||
return in;
|
||||
}
|
||||
|
||||
private:
|
||||
operator int() const { return projectPathId; }
|
||||
ProjectPartId operator++() { return ++projectPathId; }
|
||||
|
||||
public:
|
||||
int projectPathId = -1;
|
||||
};
|
||||
|
Reference in New Issue
Block a user