[mythtv-commits] Ticket #5540: In some instances where the member function is const, the return type does not need the const directive
MythTV
mythtv at cvs.mythtv.org
Sun Jul 13 00:23:46 UTC 2008
#5540: In some instances where the member function is const, the return type does
not need the const directive
---------------------------------------------+------------------------------
Reporter: Erik Hovland <erik at hovland.org> | Owner: ijr
Type: defect | Status: new
Priority: trivial | Milestone: unknown
Component: mythtv | Version: head
Severity: low | Mlocked: 0
---------------------------------------------+------------------------------
When a function is declared const like
{{{
const int getState() const { return curState; }
}}}
The const at the return type is redundant. In fact it causes the compiler
to generated a parse warning internally that causes extra code to execute.
By stripping off the extra const the compiler does not produce a parse
warning and the compiled object code is unchanged.
{{{
int getState() const { return curState; }
}}}
This defect has no effect on runtime. It is entirely for compiler
correctness.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/5540>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list