Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#14 closed bug (fixed)

QgsGeometryVertexIndex::operator= must return a value

Reported by: mloskot Owned by: gsherman
Priority: major: does not work as expected Milestone:
Component: Vectors Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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
}

Change History (3)

comment:1 by gsherman, 18 years ago

Resolution: fixed
Status: newclosed

comment:2 by anonymous, 17 years ago

Awaiting user input: unset
Must Fix for Release: No

comment:3 by (none), 15 years ago

Milestone: Version 0.8

Milestone Version 0.8 deleted

Note: See TracTickets for help on using tickets.