#pragma once #include class BaseObjectType { public: explicit BaseObjectType(const std::type_info &type_info); bool operator==(const BaseObjectType &object_type) const; [[nodiscard]] std::size_t hash() const; private: const std::type_info &_type_info; }; template class ObjectType : public BaseObjectType { public: ObjectType() : BaseObjectType(typeid(Object)) {} }; class IObjectTypeHasher { public: virtual std::size_t operator()(const BaseObjectType &object_type) const = 0; }; class ObjectTypeHasher : public IObjectTypeHasher { public: std::size_t operator()(const BaseObjectType &object_type) const override; };