I know the operator
keyword can be used to overload operators such as +=
, -=
or even the function call operator ()
.
I came across this code and cannot understand the syntax of lines A
and B
.
What do these two lines do? If they declare functions, how should the functions be used?
using INT64 = long long;
class Time
{
public:
INT64 microseconds; // data member
Time() : microseconds(0) { } // default constructor
Time& operator+= (const INT64 msec); // overloads += operator
operator INT64 () const { return microseconds; }; // line A ???
operator const timespec() const; // line B ???
}