/* name: overload-example.cxx */ #include #include "timestamp.h" /* int operator/(TimeStamp& a, int b) { return a.get() / b; } */ double operator/(TimeStamp& a, double b) { return a.get() / b; } int main(int argc, char** argv) { using namespace std; TimeStamp tts; tts.update(); cout << tts / 2 << endl; cout << tts / 2.0 << endl; return 0; }