Bug report #3917

QgsGeometryVertexIndex::operator= must return a value

Added by Mateusz Loskot - over 18 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:Gary Sherman
Category:Vectors
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13941

Description

Small bug in file qgsgeometryvertexindex.cpp (revision 4502), lines 31-34: QgsGeometryVertexIndex::operator= must return a value.

Current incomplete version:

[[QgsGeometryVertexIndex]]&
[[QgsGeometryVertexIndex]]::operator=(QgsGeometryVertexIndex const& rhs)
{
   mIndex = rhs.mIndex;
}

Possible min. required fix:

[[QgsGeometryVertexIndex]]&
[[QgsGeometryVertexIndex]]::operator=(QgsGeometryVertexIndex const& rhs)
{
   mIndex = rhs.mIndex;
   return *this
}

But I'm not sure what copy semantic is expected here.
What about self-copying?
Usually, self-copying is forbidden, then

[[QgsGeometryVertexIndex]]&
[[QgsGeometryVertexIndex]]::operator=(QgsGeometryVertexIndex
const& rhs)
{
   if (&rhs != this)
   {
      mIndex = rhs.mIndex;
   }
   return *this
}

History

#1 Updated by Gary Sherman over 18 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

#2 Updated by Anonymous over 15 years ago

Milestone Version 0.8 deleted

Also available in: Atom PDF