From 165de1002719175c75df61913d36c2189538a84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 2 May 2017 19:23:13 +0200 Subject: Introduce helper class QTaggedPointer Useful for attaching small bits of information in the alignment bits of a naked pointer. For use in the new property system as well as in qtdeclarative (where currently a similar class exists as private API). Change-Id: Idf9b93e714e15129f302e16425dbeda94bcd207b Reviewed-by: Simon Hausmann --- src/corelib/io/qdebug.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/corelib/io/qdebug.h') diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index e14d31f38a..aa69a1ae23 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -356,6 +356,16 @@ inline QDebug operator<<(QDebug debug, const QSharedPointer &ptr) return debug; } +template class QTaggedPointer; + +template +inline QDebug operator<<(QDebug debug, const QTaggedPointer &ptr) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "QTaggedPointer(" << ptr.pointer() << ", " << ptr.tag() << ")"; + return debug; +} + Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value); template -- cgit v1.2.3