#include "CCObject.h" #include "iostream" #include #include bool CTL::Object::equals(const Object *other) { return this == other; // 默认比较内存地址 } size_t CTL::Object::hashCode() const noexcept { return std::hash{}(this); } std::string CTL::Object::toString() const { char buffer[64]; snprintf(buffer, sizeof(buffer), "Object@%p", static_cast(this)); return buffer; } std::ostream & CTL::operator<<(std::ostream &os, const Object &map) { os << map.toString(); return os; }