const
to signify (to developers, not just the compiler) that a variable does not change)./**
* This method doesn't change its object
* @param[in] obj Reference to a constant MyObj
* @return A constant reference to obj
*/
const MyObj& MyObj::myMethod(const MyObj &obj) const
{
return obj;
}
No comments:
Post a Comment