C
cindy.r.mcgee
I'm doing a code review and noticed some code that's not well-written,
and I've forgotten the reason why.
Here's a brief excerpt with names changed to protect the innocent, er,
the IP:
class MyPoint
{
..
:
protected:
int x;
int y;
}
class MyRect
{
..
:
MyPoint & MyRect::TopLeft()
{
return *( ( MyPoint * ) this );
}
MyPoint & MyRect::BottomRight()
{
return *( ( MyPoint * ) this+1 );
}
..
:
protected:
LONG left;
LONG top;
LONG right;
LONG bottom;
}
and I've forgotten the reason why.
Here's a brief excerpt with names changed to protect the innocent, er,
the IP:
class MyPoint
{
..
:
protected:
int x;
int y;
}
class MyRect
{
..
:
MyPoint & MyRect::TopLeft()
{
return *( ( MyPoint * ) this );
}
MyPoint & MyRect::BottomRight()
{
return *( ( MyPoint * ) this+1 );
}
..
:
protected:
LONG left;
LONG top;
LONG right;
LONG bottom;
}