From c9590db18888376f94e6c4752e9192088a2fecac Mon Sep 17 00:00:00 2001 From: Max Kellermann <mk@cm4all.com> Date: Tue, 24 Sep 2019 15:16:07 +0200 Subject: [PATCH] util/StringView: enable string_view support only on C++17 --- src/util/StringView.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx index 2e107dcbe..8b5064785 100644 --- a/src/util/StringView.hxx +++ b/src/util/StringView.hxx @@ -36,7 +36,7 @@ #include <utility> -#if !GCC_OLDER_THAN(7,0) +#if __cplusplus >= 201703L && !GCC_OLDER_THAN(7,0) #include <string_view> #endif @@ -71,7 +71,7 @@ struct BasicStringView : ConstBuffer<T> { constexpr BasicStringView(std::nullptr_t n) noexcept :ConstBuffer<T>(n) {} -#if !GCC_OLDER_THAN(7,0) +#if __cplusplus >= 201703L && !GCC_OLDER_THAN(7,0) constexpr BasicStringView(std::basic_string_view<T> src) noexcept :ConstBuffer<T>(src.data(), src.size()) {}