cmState: Make it possible to order cmState::Snapshot.
This commit is contained in:
parent
04168cbb59
commit
55e3927634
|
@ -128,6 +128,13 @@ public:
|
||||||
}
|
}
|
||||||
return this->Position <= this->Tree->Data.size();
|
return this->Position <= this->Tree->Data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool StrictWeakOrdered(iterator other) const
|
||||||
|
{
|
||||||
|
assert(this->Tree);
|
||||||
|
assert(this->Tree == other.Tree);
|
||||||
|
return this->Position < other.Position;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
iterator Root() const
|
iterator Root() const
|
||||||
|
|
|
@ -1411,3 +1411,9 @@ void cmState::Directory::ClearCompileOptions()
|
||||||
this->DirectoryState->CompileOptionsBacktraces,
|
this->DirectoryState->CompileOptionsBacktraces,
|
||||||
this->Snapshot_.Position->CompileOptionsPosition);
|
this->Snapshot_.Position->CompileOptionsPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmState::Snapshot::StrictWeakOrder::operator()(
|
||||||
|
const cmState::Snapshot& lhs, const cmState::Snapshot& rhs) const
|
||||||
|
{
|
||||||
|
return lhs.Position.StrictWeakOrdered(rhs.Position);
|
||||||
|
}
|
||||||
|
|
|
@ -74,9 +74,16 @@ public:
|
||||||
|
|
||||||
Directory GetDirectory() const;
|
Directory GetDirectory() const;
|
||||||
|
|
||||||
|
struct StrictWeakOrder
|
||||||
|
{
|
||||||
|
bool operator()(const cmState::Snapshot& lhs,
|
||||||
|
const cmState::Snapshot& rhs) const;
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class cmState;
|
friend class cmState;
|
||||||
friend class Directory;
|
friend class Directory;
|
||||||
|
friend struct StrictWeakOrder;
|
||||||
cmState* State;
|
cmState* State;
|
||||||
cmState::PositionType Position;
|
cmState::PositionType Position;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue