c++: fix build with recent gcc with -std=c++11/14
@@ -16,9 +16,7 @@ struct RustStrView {
bool empty() const noexcept { return this->len == 0; }
std::string to_std_string() const { return std::string{ data, len }; }
#endif
-#if (defined(__clang__) && __clang_major__ >= 4) \
- || (defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 7) \
- || (defined(_MSC_VER) && _MSC_VER >= 1910)
+#if __cplusplus >= 201703L
std::string_view to_string_view() const { return std::string_view{ data, len }; }
#endif
#ifdef BOOST_STRING_VIEW_HPP
@@ -78,9 +76,7 @@ public:
std::string to_std_string() const { return std::string(data, len); }
size_t size() const noexcept { return this->len; }
bool empty() const noexcept { return this->len == 0; }
-#if (defined(__clang__) && __clang_major__ >= 4) \
- || (defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 7) \
- || (defined(_MSC_VER) && _MSC_VER >= 1910)
+#if __cplusplus >= 201703L
std::string_view to_string_view() const { return std::string_view(data, len); }
#endif
