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.
This commit is contained in:
parent
62ec7d52ce
commit
04c17c7a76
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue