diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-16 12:08:54 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-17 12:15:44 +0200 |
commit | c800e96523d4561f5ac08b5d570ca5e2f5d2a25b (patch) | |
tree | a3f26b4838bcc55724786617403ccc638fc9d183 | |
parent | 5216c561107324aa001f937f3c3c82578acbca18 (diff) |
qtypeinfo.h: We only need a const reference for most operator<<
If we require a value, then we need a dtor, too. This is not always the
case. For example QSessionManager has a private dtor, leading to
failures.
Change-Id: I3f715848ff5c63b2ea2773c17bced21e7a814ca9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 4b29d0bf53..d7cdb8b5d4 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -356,7 +356,7 @@ using compare_lt_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_o namespace detail { template<typename T> -const T const_value(); +const T &const_reference(); template<typename T> T &reference(); @@ -365,7 +365,7 @@ T &reference(); template <typename Stream, typename, typename = void> struct has_ostream_operator : std::false_type {}; template <typename Stream, typename T> -struct has_ostream_operator<Stream, T, std::void_t<decltype(detail::reference<Stream>() << detail::const_value<T>())>> +struct has_ostream_operator<Stream, T, std::void_t<decltype(detail::reference<Stream>() << detail::const_reference<T>())>> : std::true_type {}; template <typename Stream, typename T> constexpr bool has_ostream_operator_v = has_ostream_operator<Stream, T>::value; |