bool operator==(Register rhs) const { if(this->state != rhs.state) return false; switch(this->state) { case State::Int: if(this->getInteger() == rhs.getInteger()) { return true; } break; case State::String: if(this->getString() == rhs.getString()) { return true; } break; default: return false; } return false; };
bool operator<(Register rhs) { if(this->state != rhs.state) { throw std::exception(); } switch(this->state) { case State::Int: if(this->getInteger() < rhs.getInteger()) { return true; } break; case State::String: if(this->getString() < rhs.getString()) { return true; } break; default: return false; } return false; };