diff --git a/src/MeoAssistant/Logger.hpp b/src/MeoAssistant/Logger.hpp index 391ea60143..c7b149e2ce 100644 --- a/src/MeoAssistant/Logger.hpp +++ b/src/MeoAssistant/Logger.hpp @@ -10,6 +10,7 @@ #include #include "AsstUtils.hpp" +#include "AsstRanges.hpp" #include "Version.h" namespace asst @@ -171,22 +172,7 @@ namespace asst struct has_stream_insertion_operator< Stream, T, std::void_t() << std::declval())>> - : std::true_type - { - }; - - template - struct is_range_expression : std::false_type {}; - - template - struct is_range_expression()))>::iterator_category, - std::forward_iterator_tag - > - >> : std::true_type - { - }; + : std::true_type {}; template static Stream& stream_put(Stream& s, T&& v) @@ -200,7 +186,7 @@ namespace asst s << std::forward(v); return s; } - else if constexpr (is_range_expression::value) { + else if constexpr (ranges::input_range) { s << "["; std::string_view comma{}; for (const auto& elem : std::forward(v)) { @@ -213,11 +199,11 @@ namespace asst } else { ASST_STATIC_ASSERT_FALSE( - "\nunsupported type, one of the following expected\n" - "\t1. those can be converted to string;\n" - "\t2. those can be inserted to stream with operator<< directly;\n" - "\t3. container or nested container containing 1. 2. or 3. and iterable with range-based for", - Stream, T); + "\nunsupported type, one of the following expected\n" + "\t1. those can be converted to string;\n" + "\t2. those can be inserted to stream with operator<< directly;\n" + "\t3. container or nested container containing 1. 2. or 3. and iterable with range-based for", + Stream, T); } }