浏览代码

CObject: Add LogStream operator<< for CObject.

Andreas Kling 6 年之前
父节点
当前提交
b4329a8eec
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Libraries/LibCore/CObject.h

+ 5 - 0
Libraries/LibCore/CObject.h

@@ -99,3 +99,8 @@ inline void CObject::for_each_child_of_type(Callback callback)
         return IterationDecision::Continue;
     });
 }
+
+inline const LogStream& operator<<(const LogStream& stream, const CObject& object)
+{
+    return stream << object.class_name() << '{' << &object << '}';
+}