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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user