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>
bb10
Ulf Hermann 2020-10-16 12:08:54 +02:00
parent 5216c56110
commit c800e96523
1 changed files with 2 additions and 2 deletions

View File

@ -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;