diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h index 48f91d600..562e5e03f 100644 --- a/include/flatbuffers/base.h +++ b/include/flatbuffers/base.h @@ -212,6 +212,13 @@ namespace flatbuffers { typedef std::experimental::string_view string_view; } #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for absl::string_view + #elif __has_include("absl/strings/string_view.h") + #include "absl/strings/string_view.h" + namespace flatbuffers { + typedef absl::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 #endif #endif // __has_include #endif // !FLATBUFFERS_HAS_STRING_VIEW