diff options
Diffstat (limited to 'absl/strings/string_view.h')
-rw-r--r-- | absl/strings/string_view.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h index 04ca0a38..ff760014 100644 --- a/absl/strings/string_view.h +++ b/absl/strings/string_view.h @@ -159,7 +159,7 @@ ABSL_NAMESPACE_BEGIN // // absl::string_view() == absl::string_view("", 0) // absl::string_view(nullptr, 0) == absl::string_view("abcdef"+6, 0) -class string_view { +class ABSL_INTERNAL_ATTRIBUTE_VIEW string_view { public: using traits_type = std::char_traits<char>; using value_type = char; @@ -173,6 +173,7 @@ class string_view { using reverse_iterator = const_reverse_iterator; using size_type = size_t; using difference_type = std::ptrdiff_t; + using absl_internal_is_view = std::true_type; static constexpr size_type npos = static_cast<size_type>(-1); @@ -670,7 +671,7 @@ class string_view { } static constexpr size_type StrlenInternal(absl::Nonnull<const char*> str) { -#if defined(_MSC_VER) && _MSC_VER >= 1910 && !defined(__clang__) +#if defined(_MSC_VER) && !defined(__clang__) // MSVC 2017+ can evaluate this at compile-time. const char* begin = str; while (*str != '\0') ++str; |