mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 08:12:01 +00:00
Update FLATBUFFERS_HAS_STRING_VIEW __cplusplus checks to the versions provided by the standard feature test macros. (#4841)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
1bb2a3bd08
commit
118093b613
@@ -158,14 +158,14 @@
|
|||||||
// to detect a header that provides an implementation
|
// to detect a header that provides an implementation
|
||||||
#if defined(__has_include)
|
#if defined(__has_include)
|
||||||
// Check for std::string_view (in c++17)
|
// Check for std::string_view (in c++17)
|
||||||
#if __has_include(<string_view>) && (__cplusplus > 201402)
|
#if __has_include(<string_view>) && (__cplusplus >= 201606)
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
namespace flatbuffers {
|
namespace flatbuffers {
|
||||||
typedef std::string_view string_view;
|
typedef std::string_view string_view;
|
||||||
}
|
}
|
||||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||||
// Check for std::experimental::string_view (in c++14, compiler-dependent)
|
// Check for std::experimental::string_view (in c++14, compiler-dependent)
|
||||||
#elif __has_include(<experimental/string_view>) && (__cplusplus > 201103)
|
#elif __has_include(<experimental/string_view>) && (__cplusplus >= 201411)
|
||||||
#include <experimental/string_view>
|
#include <experimental/string_view>
|
||||||
namespace flatbuffers {
|
namespace flatbuffers {
|
||||||
typedef std::experimental::string_view string_view;
|
typedef std::experimental::string_view string_view;
|
||||||
|
|||||||
Reference in New Issue
Block a user