Change GraphBase::NeighborIterator to use pointer to graph instead of reference

This enables default copy-assignment operator and copy constructor.
Also removed GraphBase::NeighborIterator::operator!=(), since it will be generated from the equality operator.
This commit is contained in:
2025-06-23 20:51:16 +02:00
parent b71d904770
commit 1834109040
2 changed files with 8 additions and 12 deletions

View File

@@ -41,12 +41,12 @@ bool GraphBase::areAdjacent(const int vertex1, const int vertex2) const
GraphBase::NeighborIterator GraphBase::begin(const int vertex) const
{
return { *this, vertex };
return { this, vertex };
}
GraphBase::NeighborIterator GraphBase::end() const
{
return { *this, -1 };
return { this, -1 };
}
int GraphBase::addVertexInternal()