Commit 55e39276 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmState: Make it possible to order cmState::Snapshot.

parent 04168cbb
......@@ -128,6 +128,13 @@ public:
}
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
......
......@@ -1411,3 +1411,9 @@ void cmState::Directory::ClearCompileOptions()
this->DirectoryState->CompileOptionsBacktraces,
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;
struct StrictWeakOrder
{
bool operator()(const cmState::Snapshot& lhs,
const cmState::Snapshot& rhs) const;
};
private:
friend class cmState;
friend class Directory;
friend struct StrictWeakOrder;
cmState* State;
cmState::PositionType Position;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment