From 8ad9e81694fda39fbecebb9f97491004e9ac8c41 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 6 Jul 2020 13:08:40 +0200 Subject: Constrain the debug stream operators for containers Check that we can successfully instantiate the debug stream operator for a container before we actually try. This is required so we can automate registration of debug stream operators with QMetaType. Change-Id: I3943e7a443751d250c33b2ca1b9cf29207cfe6c4 Reviewed-by: Fabian Kosmale --- tests/auto/corelib/io/qdebug/tst_qdebug.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/corelib/io/qdebug/tst_qdebug.cpp') diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp index ece9be642a..72412aa44d 100644 --- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp +++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp @@ -35,6 +35,12 @@ #include #include +static_assert(QTypeTraits::has_ostream_v); +static_assert(QTypeTraits::has_ostream_v>); +struct NonStreamable {}; +static_assert(!QTypeTraits::has_ostream_v); +static_assert(!QTypeTraits::has_ostream_v>); + class tst_QDebug: public QObject { Q_OBJECT -- cgit v1.2.3