Replace deprecated Vector::Length() with Vector::size() (#5131)

- enable FLATBUFFERS_ATTRIBUTE if C++17 or higher
This commit is contained in:
Vladimir Glavnyy
2019-01-25 04:33:19 +07:00
committed by Wouter van Oortmerssen
parent 3f388ec747
commit fcacb46d01
6 changed files with 16 additions and 16 deletions

View File

@@ -235,11 +235,11 @@ template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
return !!t;
}
// Enable of std:c++17 or higher.
// Enable C++ attribute [[]] if std:c++17 or higher.
#if (defined(__cplusplus) && (__cplusplus >= 201703L)) || \
(defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
// All attributes unknown to an implementation are ignored without causing an error.
#define FLATBUFFERS_ATTRIBUTE(attr) // [[attr]] - will be enabled in a future release
#define FLATBUFFERS_ATTRIBUTE(attr) [[attr]]
#else
#define FLATBUFFERS_ATTRIBUTE(attr)
#endif