Commit 04c17c7a authored by Austin Schuh's avatar Austin Schuh Committed by Wouter van Oortmerssen

Add support for absl::string_view when available (#5682)

For C++11 platforms, absl::string_view is sometimes available. This can
be used for string_view when std::string_view is not available.
parent 62ec7d52
...@@ -212,6 +212,13 @@ namespace flatbuffers { ...@@ -212,6 +212,13 @@ namespace flatbuffers {
typedef std::experimental::string_view string_view; typedef std::experimental::string_view string_view;
} }
#define FLATBUFFERS_HAS_STRING_VIEW 1 #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
#endif // __has_include #endif // __has_include
#endif // !FLATBUFFERS_HAS_STRING_VIEW #endif // !FLATBUFFERS_HAS_STRING_VIEW
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment