#include "SillyT.h" #include #include using namespace std; SillyT::SillyT() { intVal = rand() * 1000; stringVal = "hello"; } void SillyT::String(string s) { stringVal = s; } string SillyT::String(void) const{ return stringVal; } void SillyT::Int(int i) { intVal = i; } int SillyT::Int(void) const { return intVal; } bool SillyT::operator ==(const SillyT & other) { bool rv = false; if (intVal == other.intVal) { rv = stringVal == other.stringVal; } else { rv = intVal == other.intVal; } return rv; } bool SillyT::operator < (const SillyT & other) { bool rv; if (intVal == other.intVal) { rv = stringVal < other.stringVal; } else { rv = intVal < other.intVal; } return rv; }