Is it safe for me to delete one of those two functions with the same name 'getTime'

From: Xiangliang Meng (xiangliang_meng_at_hotmail.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 14:37:19 +0800

Hi, all

class Clock
{
   Clock() { Time_m = 0;}
   void setTime(unsigned int time = 0)
   {
      Time_m = time;
   }
   unsigned int getTime() const
   {
      return Time_m;
   }
   unsigned int getTime()
   {
      return Time_m;
   }
private:
   unsigned int Time_m;
};

Is it safe for me to delete one of those two functions with the same name
'getTime'? Are there 'big' differences between those two funtions for users
of this class?

If I find some function call Clock::getTime(), how can I know whether it
will invoke the first one or the second one?

Best Regards,

Xiangliang Meng



Relevant Pages