From 6964c21c10253ddd0df01bc4a22c05afece1ac53 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Fri, 24 Jan 2020 01:11:07 -0600 Subject: [PATCH 01/12] Utility::Debug: DebugOstreamFallback enable if has ostream operator --- src/Corrade/Utility/DebugStl.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index 823bf5747..eaa7e70d8 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -103,9 +103,32 @@ template Debug& operator<<(Debug& debug, const std::tuple +typename std::add_lvalue_reference::type declare_lvalue_reference() noexcept; + +template +struct has_ostream_operator { + private: + template + static constexpr auto check(C *) -> + typename std::is_same< + decltype(declare_lvalue_reference() << std::declval()), + std::add_lvalue_reference::type + >::type; + + template + static constexpr std::false_type check(...); + + public: + static constexpr bool value = decltype(check(nullptr))::value; +}; + /* Used by Debug::operator<<(Implementation::DebugOstreamFallback&&) */ struct DebugOstreamFallback { - template /*implicit*/ DebugOstreamFallback(const T& t): applier(&DebugOstreamFallback::applyImpl), value(&t) {} + template< + class T, + typename = typename std::enable_if::value>::type + > /*implicit*/ DebugOstreamFallback(const T& t): applier(&DebugOstreamFallback::applyImpl), value(&t) {} void apply(std::ostream& s) const { (this->*applier)(s); From dfa849b05e76ca38abfe31bd789cf14711b80e74 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Mon, 27 Jan 2020 22:38:04 -0600 Subject: [PATCH 02/12] Move DeclareLvalueReference to TypeTraits.h simplified HasOstreamOperator by using CORRADE_HAS_TYPE macro renamed both to magnum schemes --- src/Corrade/Utility/DebugStl.h | 28 ++++++++-------------------- src/Corrade/Utility/TypeTraits.h | 6 ++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index eaa7e70d8..59d43cd95 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -103,31 +103,19 @@ template Debug& operator<<(Debug& debug, const std::tuple -typename std::add_lvalue_reference::type declare_lvalue_reference() noexcept; - -template -struct has_ostream_operator { - private: - template - static constexpr auto check(C *) -> - typename std::is_same< - decltype(declare_lvalue_reference() << std::declval()), - std::add_lvalue_reference::type - >::type; - - template - static constexpr std::false_type check(...); - - public: - static constexpr bool value = decltype(check(nullptr))::value; -}; +CORRADE_HAS_TYPE( + HasOstreamOperator, + typename std::enable_if() << std::declval()), + std::add_lvalue_reference::type + >::value>::type +); /* Used by Debug::operator<<(Implementation::DebugOstreamFallback&&) */ struct DebugOstreamFallback { template< class T, - typename = typename std::enable_if::value>::type + typename = typename std::enable_if::value>::type > /*implicit*/ DebugOstreamFallback(const T& t): applier(&DebugOstreamFallback::applyImpl), value(&t) {} void apply(std::ostream& s) const { diff --git a/src/Corrade/Utility/TypeTraits.h b/src/Corrade/Utility/TypeTraits.h index 6d3b92ec0..7dbcbff5c 100644 --- a/src/Corrade/Utility/TypeTraits.h +++ b/src/Corrade/Utility/TypeTraits.h @@ -163,4 +163,10 @@ template using IsStringLike = std::integral_constant +typename std::add_lvalue_reference::type DeclareLvalueReference() noexcept; + #endif From 8b1e93575dcc26b9ecc0762670be3ec5b97475b4 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Tue, 28 Jan 2020 18:39:30 -0600 Subject: [PATCH 03/12] Utility::Debug: add HasDebugStreamOperator check to DebugOstreamFallback --- src/Corrade/Utility/DebugStl.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index 59d43cd95..3f47523ed 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -111,11 +111,19 @@ CORRADE_HAS_TYPE( >::value>::type ); +CORRADE_HAS_TYPE( + HasDebugStreamOperator, + typename std::enable_if() << std::declval()), + std::add_lvalue_reference::type + >::value>::type +); + /* Used by Debug::operator<<(Implementation::DebugOstreamFallback&&) */ struct DebugOstreamFallback { template< class T, - typename = typename std::enable_if::value>::type + typename = typename std::enable_if::value && !HasDebugStreamOperator::value>::type > /*implicit*/ DebugOstreamFallback(const T& t): applier(&DebugOstreamFallback::applyImpl), value(&t) {} void apply(std::ostream& s) const { From cf3f6fd5741a840739eabb4160cba8d89738a4bf Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Tue, 28 Jan 2020 18:41:25 -0600 Subject: [PATCH 04/12] Utility::Debug: added std::ostream output operator call converter. --- src/Corrade/Utility/DebugStl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index 3f47523ed..5a790ab4c 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -149,4 +149,14 @@ CORRADE_UTILITY_EXPORT Debug& operator<<(Debug& debug, Implementation::DebugOstr }} +template +typename std::enable_if< + Corrade::Utility::Implementation::HasDebugStreamOperator::value && !Corrade::Utility::Implementation::HasOstreamOperator::value, + std::ostream +>::type &operator<<(std::ostream &os, const T &val) { + Corrade::Utility::Debug debug{&os, Corrade::Utility::Debug::Flag::NoNewlineAtTheEnd}; + debug << val; + return os; +} + #endif From 8b048e6cb9227bbd703ae3c338ed01dac9f569d9 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Wed, 29 Jan 2020 00:20:29 -0600 Subject: [PATCH 05/12] Utility: doc++ --- src/Corrade/Utility/TypeTraits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Corrade/Utility/TypeTraits.h b/src/Corrade/Utility/TypeTraits.h index 7dbcbff5c..1a75bc236 100644 --- a/src/Corrade/Utility/TypeTraits.h +++ b/src/Corrade/Utility/TypeTraits.h @@ -164,7 +164,7 @@ template using IsStringLike = std::integral_constant typename std::add_lvalue_reference::type DeclareLvalueReference() noexcept; From 05cfb243958b644329aaa6a48a9226de1c19dc99 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Sun, 2 Feb 2020 01:13:24 -0600 Subject: [PATCH 06/12] Utility::Debug: OstreamDebug::operator<< is now in its own namespace added documentation added a snippet --- doc/snippets/Utility.cpp | 15 ++++++ src/Corrade/Utility/Debug.h | 7 +++ src/Corrade/Utility/DebugStl.h | 12 ++++- src/Corrade/Utility/Test/DebugTest.cpp | 69 +++++++++++++++++++++++++- src/Corrade/Utility/TypeTraits.h | 3 +- 5 files changed, 102 insertions(+), 4 deletions(-) diff --git a/doc/snippets/Utility.cpp b/doc/snippets/Utility.cpp index 89e0ec015..9019acdd5 100644 --- a/doc/snippets/Utility.cpp +++ b/doc/snippets/Utility.cpp @@ -319,6 +319,21 @@ else /* [Debug-usage] */ } +{ +auto sendMessage = [](const std::string &) {}; +/* [Debug-ostream-delegation] */ +using Utility::OstreamDebug::operator<<; +/// unfinished +Containers::Array array{Containers::InPlaceInit, { 0.1, 22.22, 3.14 }}; +std::cout << "array = " << array << std::endl; + +std::ostringstream o; +o << array << std::endl; +sendMessage(o.str()); +/// unfinished +/* [Debug-ostream-delegation] */ +} + { /* [Debug-scoped-output] */ std::ostringstream debugOut, errorOut; diff --git a/src/Corrade/Utility/Debug.h b/src/Corrade/Utility/Debug.h index 7c6a3f5ae..5b2fd9124 100644 --- a/src/Corrade/Utility/Debug.h +++ b/src/Corrade/Utility/Debug.h @@ -82,6 +82,13 @@ type using @ref Debug. Note that printing @ref std::vector or @ref std::map containers is already possible with the generic iterable container support in @ref Corrade/Utility/Debug.h. +@subsection Utility-Debug-stl-ostream-delegation Ostream Delegation + +@ref Corrade/Utility/DebugStl.h also provides an @ref std::ostream @cpp +operator<<() @ce for printing builtin types: + +@snippet Utility.cpp Debug-ostream-delegation + @section Utility-Debug-scoped-output Scoped output redirection Output specified in class constructor is used for all instances created during diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index 5a790ab4c..e4df9359f 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -147,8 +147,14 @@ struct DebugOstreamFallback { CORRADE_UTILITY_EXPORT Debug& operator<<(Debug& debug, Implementation::DebugOstreamFallback&& value); #endif -}} +namespace OstreamDebug { + +/** +@brief Print a builtin type to an ostream +Allows calls like @cpp std::cout << Magnum::Vector2{0.2, 3.14}; @ce to be +delegated to a @ref Debug object. Creates a @ref Debug object on every call. +*/ template typename std::enable_if< Corrade::Utility::Implementation::HasDebugStreamOperator::value && !Corrade::Utility::Implementation::HasOstreamOperator::value, @@ -159,4 +165,8 @@ typename std::enable_if< return os; } +} + +}} + #endif diff --git a/src/Corrade/Utility/Test/DebugTest.cpp b/src/Corrade/Utility/Test/DebugTest.cpp index 06589cf3a..bf60dc0ed 100644 --- a/src/Corrade/Utility/Test/DebugTest.cpp +++ b/src/Corrade/Utility/Test/DebugTest.cpp @@ -31,7 +31,7 @@ #include #include "Corrade/TestSuite/Tester.h" -#include "Corrade/Utility/Debug.h" +#include "Corrade/Containers/Array.h" #include "Corrade/Utility/DebugStl.h" #ifndef CORRADE_TARGET_EMSCRIPTEN @@ -81,6 +81,12 @@ struct DebugTest: TestSuite::Tester { void ostreamFallback(); void ostreamFallbackPriority(); + + void ostreamDelegationInternalUsing(); + void ostreamDelegationExternalUsing(); + void ostreamDelegationCyclicDependency(); + void ostreamDelegationPriority(); + void ostreamDelegationPriorityImplicitConversion(); void scopedOutput(); @@ -150,6 +156,12 @@ DebugTest::DebugTest() { &DebugTest::ostreamFallback, &DebugTest::ostreamFallbackPriority, + + &DebugTest::ostreamDelegationInternalUsing, + &DebugTest::ostreamDelegationExternalUsing, + &DebugTest::ostreamDelegationCyclicDependency, + &DebugTest::ostreamDelegationPriority, + &DebugTest::ostreamDelegationPriorityImplicitConversion, &DebugTest::scopedOutput, @@ -819,6 +831,61 @@ void DebugTest::ostreamFallbackPriority() { CORRADE_COMPARE(out.str(), "baz from Debug\n"); } +namespace OstreamDelegationNamespace0 { + struct Corge { + int i; + }; + + inline Debug& operator<<(Debug& debug, const Corge& val) { + return debug << val.i << "corge from Debug"; + } +} + +void DebugTest::ostreamDelegationInternalUsing() { + using OstreamDebug::operator<<; + std::ostringstream out; + out << OstreamDelegationNamespace0::Corge{42}; + CORRADE_COMPARE(out.str(), "42 corge from Debug"); +} + +namespace OstreamDelegationNamespace1 { + struct Grault { + int i; + }; + + inline Debug& operator<<(Debug& debug, const Grault& val) { + return debug << val.i << "grault from Debug"; + } + + using OstreamDebug::operator<<; +} + +void DebugTest::ostreamDelegationExternalUsing() { + std::ostringstream out; + out << OstreamDelegationNamespace1::Grault{36}; + CORRADE_COMPARE(out.str(), "36 grault from Debug"); +} + +struct ClassWithoutStreamOperator {}; + +void DebugTest::ostreamDelegationCyclicDependency() { + CORRADE_VERIFY(!Implementation::HasOstreamOperator::value); + CORRADE_VERIFY(!Implementation::HasDebugStreamOperator::value); +} + +void DebugTest::ostreamDelegationPriority() { + std::ostringstream out; + out << Baz{}; + CORRADE_COMPARE(out.str(), "baz from ostream"); +} + +void DebugTest::ostreamDelegationPriorityImplicitConversion() { + Containers::Array array{Containers::InPlaceInit, { 1, 2, 3 }}; + std::ostringstream out; + out << array; + CORRADE_COMPARE(out.str(), "{ 1, 2, 3 }"); +} + void DebugTest::scopedOutput() { std::ostringstream debug1, debug2, warning1, warning2, error1, error2; diff --git a/src/Corrade/Utility/TypeTraits.h b/src/Corrade/Utility/TypeTraits.h index 1a75bc236..78d9cdb02 100644 --- a/src/Corrade/Utility/TypeTraits.h +++ b/src/Corrade/Utility/TypeTraits.h @@ -166,7 +166,6 @@ template using IsStringLike = std::integral_constant -typename std::add_lvalue_reference::type DeclareLvalueReference() noexcept; +template typename std::add_lvalue_reference::type DeclareLvalueReference() noexcept; #endif From 3b75172fa76258f99f78bf762d7c367cd5621b3b Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Sun, 2 Feb 2020 15:59:14 -0600 Subject: [PATCH 07/12] Utility::Debug: more docs --- src/Corrade/Utility/Debug.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Corrade/Utility/Debug.h b/src/Corrade/Utility/Debug.h index 5b2fd9124..e3df3c6fd 100644 --- a/src/Corrade/Utility/Debug.h +++ b/src/Corrade/Utility/Debug.h @@ -89,6 +89,10 @@ operator<<() @ce for printing builtin types: @snippet Utility.cpp Debug-ostream-delegation +It must be brought into the current namespace by a using declaration: + +@cpp using Corrade::Utility::OstreamDebug::operator<<; @ce + @section Utility-Debug-scoped-output Scoped output redirection Output specified in class constructor is used for all instances created during From be5dfa9bb5735419bf2e42a15da99fde4081038a Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Sun, 2 Feb 2020 16:16:45 -0600 Subject: [PATCH 08/12] Utility: snippet had narrowing conversion --- doc/snippets/Utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/snippets/Utility.cpp b/doc/snippets/Utility.cpp index 9019acdd5..5d98a1f38 100644 --- a/doc/snippets/Utility.cpp +++ b/doc/snippets/Utility.cpp @@ -324,7 +324,7 @@ auto sendMessage = [](const std::string &) {}; /* [Debug-ostream-delegation] */ using Utility::OstreamDebug::operator<<; /// unfinished -Containers::Array array{Containers::InPlaceInit, { 0.1, 22.22, 3.14 }}; +Containers::Array array{Containers::InPlaceInit, { 0.1f, 22.22f, 3.14f }}; std::cout << "array = " << array << std::endl; std::ostringstream o; From 9abf7c3b89316c5a0ab36e66683cd7d59fbcc9b4 Mon Sep 17 00:00:00 2001 From: bowling-allie Date: Sun, 2 Feb 2020 16:18:01 -0600 Subject: [PATCH 09/12] Utility: DebugTest.cpp: corrected sourceLocation test adding tests before the sourceLocation changed the line numbers it was testing --- src/Corrade/Utility/Test/DebugTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Corrade/Utility/Test/DebugTest.cpp b/src/Corrade/Utility/Test/DebugTest.cpp index bf60dc0ed..a4c8b3ace 100644 --- a/src/Corrade/Utility/Test/DebugTest.cpp +++ b/src/Corrade/Utility/Test/DebugTest.cpp @@ -1022,9 +1022,9 @@ void DebugTest::sourceLocation() { #ifdef CORRADE_UTILITY_DEBUG_HAS_SOURCE_LOCATION CORRADE_COMPARE(out.str(), - __FILE__ ":947: hello\n" - __FILE__ ":949: and this is from another line\n" - __FILE__ ":951\n" + __FILE__ ":1014: hello\n" + __FILE__ ":1016: and this is from another line\n" + __FILE__ ":1018\n" "this no longer\n"); #else CORRADE_COMPARE(out.str(), From b3129edc7132f5df2a30d60e2d8ad54459393f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Feb 2020 15:05:44 +0100 Subject: [PATCH 10/12] Utility: whitespace at EOL. --- src/Corrade/Utility/Test/DebugTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Corrade/Utility/Test/DebugTest.cpp b/src/Corrade/Utility/Test/DebugTest.cpp index a4c8b3ace..74f081ec4 100644 --- a/src/Corrade/Utility/Test/DebugTest.cpp +++ b/src/Corrade/Utility/Test/DebugTest.cpp @@ -81,7 +81,7 @@ struct DebugTest: TestSuite::Tester { void ostreamFallback(); void ostreamFallbackPriority(); - + void ostreamDelegationInternalUsing(); void ostreamDelegationExternalUsing(); void ostreamDelegationCyclicDependency(); @@ -156,7 +156,7 @@ DebugTest::DebugTest() { &DebugTest::ostreamFallback, &DebugTest::ostreamFallbackPriority, - + &DebugTest::ostreamDelegationInternalUsing, &DebugTest::ostreamDelegationExternalUsing, &DebugTest::ostreamDelegationCyclicDependency, @@ -856,7 +856,7 @@ namespace OstreamDelegationNamespace1 { inline Debug& operator<<(Debug& debug, const Grault& val) { return debug << val.i << "grault from Debug"; } - + using OstreamDebug::operator<<; } From 07dad62425f64efd5957316994f3ee7d38ce9cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Feb 2020 15:06:12 +0100 Subject: [PATCH 11/12] Utility: this is how it is expected to work. --- src/Corrade/Utility/Test/DebugTest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Corrade/Utility/Test/DebugTest.cpp b/src/Corrade/Utility/Test/DebugTest.cpp index 74f081ec4..cfd88e2c4 100644 --- a/src/Corrade/Utility/Test/DebugTest.cpp +++ b/src/Corrade/Utility/Test/DebugTest.cpp @@ -880,10 +880,11 @@ void DebugTest::ostreamDelegationPriority() { } void DebugTest::ostreamDelegationPriorityImplicitConversion() { + using OstreamDebug::operator<<; Containers::Array array{Containers::InPlaceInit, { 1, 2, 3 }}; std::ostringstream out; out << array; - CORRADE_COMPARE(out.str(), "{ 1, 2, 3 }"); + CORRADE_COMPARE(out.str(), "{1, 2, 3}"); } void DebugTest::scopedOutput() { @@ -1022,9 +1023,9 @@ void DebugTest::sourceLocation() { #ifdef CORRADE_UTILITY_DEBUG_HAS_SOURCE_LOCATION CORRADE_COMPARE(out.str(), - __FILE__ ":1014: hello\n" - __FILE__ ":1016: and this is from another line\n" - __FILE__ ":1018\n" + __FILE__ ":1015: hello\n" + __FILE__ ":1017: and this is from another line\n" + __FILE__ ":1019\n" "this no longer\n"); #else CORRADE_COMPARE(out.str(), From ccb7bcd9ed80da69611ccf391d9cae698c663f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Feb 2020 15:26:01 +0100 Subject: [PATCH 12/12] Utility: eureka! --- src/Corrade/Utility/DebugStl.h | 30 ++++++++++++++++++++------ src/Corrade/Utility/Test/DebugTest.cpp | 4 ++-- src/Corrade/Utility/TypeTraits.h | 5 ----- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/Corrade/Utility/DebugStl.h b/src/Corrade/Utility/DebugStl.h index e4df9359f..9aca008a6 100644 --- a/src/Corrade/Utility/DebugStl.h +++ b/src/Corrade/Utility/DebugStl.h @@ -103,18 +103,36 @@ template Debug& operator<<(Debug& debug, const std::tuple << std::declval()) and + decltype(DeclareLvalueReference << std::declval()) + + would yield "yes" in both cases, not telling us which one is better. Instead + we supply an object that's implicitly convertible to both as the first + argument, giving the overload resolution magic a chance to pick the better + fitting one. */ +struct OstreamOrDebug { + /*implicit*/ operator std::ostream&(); + /*implicit*/ operator Debug&(); +}; + CORRADE_HAS_TYPE( - HasOstreamOperator, + HasBestFittingOstreamOperator, typename std::enable_if() << std::declval()), + decltype(std::declval() << std::declval()), std::add_lvalue_reference::type >::value>::type ); CORRADE_HAS_TYPE( - HasDebugStreamOperator, + HasBestFittingDebugOperator, typename std::enable_if() << std::declval()), + decltype(std::declval() << std::declval()), std::add_lvalue_reference::type >::value>::type ); @@ -123,7 +141,7 @@ CORRADE_HAS_TYPE( struct DebugOstreamFallback { template< class T, - typename = typename std::enable_if::value && !HasDebugStreamOperator::value>::type + typename = typename std::enable_if::value>::type > /*implicit*/ DebugOstreamFallback(const T& t): applier(&DebugOstreamFallback::applyImpl), value(&t) {} void apply(std::ostream& s) const { @@ -157,7 +175,7 @@ delegated to a @ref Debug object. Creates a @ref Debug object on every call. */ template typename std::enable_if< - Corrade::Utility::Implementation::HasDebugStreamOperator::value && !Corrade::Utility::Implementation::HasOstreamOperator::value, + Implementation::HasBestFittingDebugOperator::value, std::ostream >::type &operator<<(std::ostream &os, const T &val) { Corrade::Utility::Debug debug{&os, Corrade::Utility::Debug::Flag::NoNewlineAtTheEnd}; diff --git a/src/Corrade/Utility/Test/DebugTest.cpp b/src/Corrade/Utility/Test/DebugTest.cpp index cfd88e2c4..a28967e98 100644 --- a/src/Corrade/Utility/Test/DebugTest.cpp +++ b/src/Corrade/Utility/Test/DebugTest.cpp @@ -869,8 +869,8 @@ void DebugTest::ostreamDelegationExternalUsing() { struct ClassWithoutStreamOperator {}; void DebugTest::ostreamDelegationCyclicDependency() { - CORRADE_VERIFY(!Implementation::HasOstreamOperator::value); - CORRADE_VERIFY(!Implementation::HasDebugStreamOperator::value); + CORRADE_VERIFY(!Implementation::HasBestFittingOstreamOperator::value); + CORRADE_VERIFY(!Implementation::HasBestFittingDebugOperator::value); } void DebugTest::ostreamDelegationPriority() { diff --git a/src/Corrade/Utility/TypeTraits.h b/src/Corrade/Utility/TypeTraits.h index 78d9cdb02..6d3b92ec0 100644 --- a/src/Corrade/Utility/TypeTraits.h +++ b/src/Corrade/Utility/TypeTraits.h @@ -163,9 +163,4 @@ template using IsStringLike = std::integral_constant typename std::add_lvalue_reference::type DeclareLvalueReference() noexcept; - #endif