stl_emulation.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. /*
  2. * Copyright 2017 Google Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef FLATBUFFERS_STL_EMULATION_H_
  17. #define FLATBUFFERS_STL_EMULATION_H_
  18. // clang-format off
  19. #include "flatbuffers/base.h"
  20. #include <string>
  21. #include <type_traits>
  22. #include <vector>
  23. #include <memory>
  24. #include <limits>
  25. // Detect C++17 compatible compiler.
  26. // __cplusplus >= 201703L - a compiler has support of 'static inline' variables.
  27. #if defined(FLATBUFFERS_USE_STD_OPTIONAL) \
  28. || (defined(__cplusplus) && __cplusplus >= 201703L) \
  29. || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
  30. #include <optional>
  31. #ifndef FLATBUFFERS_USE_STD_OPTIONAL
  32. #define FLATBUFFERS_USE_STD_OPTIONAL
  33. #endif
  34. #endif // defined(FLATBUFFERS_USE_STD_OPTIONAL) ...
  35. // The __cpp_lib_span is the predefined feature macro.
  36. #if defined(FLATBUFFERS_USE_STD_SPAN)
  37. #include <span>
  38. #elif defined(__cpp_lib_span) && defined(__has_include)
  39. #if __has_include(<span>)
  40. #include <span>
  41. #define FLATBUFFERS_USE_STD_SPAN
  42. #endif
  43. #else
  44. // Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
  45. #if !defined(FLATBUFFERS_TEMPLATES_ALIASES)
  46. #define FLATBUFFERS_SPAN_MINIMAL
  47. #else
  48. // Enable implicit construction of a span<T,N> from a std::array<T,N>.
  49. #include <array>
  50. #endif
  51. #endif // defined(FLATBUFFERS_USE_STD_SPAN)
  52. // This header provides backwards compatibility for older versions of the STL.
  53. namespace flatbuffers {
  54. #if defined(FLATBUFFERS_TEMPLATES_ALIASES)
  55. template <typename T>
  56. using numeric_limits = std::numeric_limits<T>;
  57. #else
  58. template <typename T> class numeric_limits :
  59. public std::numeric_limits<T> {};
  60. #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
  61. #if defined(FLATBUFFERS_TEMPLATES_ALIASES)
  62. template <typename T> using is_scalar = std::is_scalar<T>;
  63. template <typename T, typename U> using is_same = std::is_same<T,U>;
  64. template <typename T> using is_floating_point = std::is_floating_point<T>;
  65. template <typename T> using is_unsigned = std::is_unsigned<T>;
  66. template <typename T> using is_enum = std::is_enum<T>;
  67. template <typename T> using make_unsigned = std::make_unsigned<T>;
  68. template<bool B, class T, class F>
  69. using conditional = std::conditional<B, T, F>;
  70. template<class T, T v>
  71. using integral_constant = std::integral_constant<T, v>;
  72. template <bool B>
  73. using bool_constant = integral_constant<bool, B>;
  74. using true_type = std::true_type;
  75. using false_type = std::false_type;
  76. #else
  77. // MSVC 2010 doesn't support C++11 aliases.
  78. template <typename T> struct is_scalar : public std::is_scalar<T> {};
  79. template <typename T, typename U> struct is_same : public std::is_same<T,U> {};
  80. template <typename T> struct is_floating_point :
  81. public std::is_floating_point<T> {};
  82. template <typename T> struct is_unsigned : public std::is_unsigned<T> {};
  83. template <typename T> struct is_enum : public std::is_enum<T> {};
  84. template <typename T> struct make_unsigned : public std::make_unsigned<T> {};
  85. template<bool B, class T, class F>
  86. struct conditional : public std::conditional<B, T, F> {};
  87. template<class T, T v>
  88. struct integral_constant : public std::integral_constant<T, v> {};
  89. template <bool B>
  90. struct bool_constant : public integral_constant<bool, B> {};
  91. typedef bool_constant<true> true_type;
  92. typedef bool_constant<false> false_type;
  93. #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
  94. #if defined(FLATBUFFERS_TEMPLATES_ALIASES)
  95. template <class T> using unique_ptr = std::unique_ptr<T>;
  96. #else
  97. // MSVC 2010 doesn't support C++11 aliases.
  98. // We're manually "aliasing" the class here as we want to bring unique_ptr
  99. // into the flatbuffers namespace. We have unique_ptr in the flatbuffers
  100. // namespace we have a completely independent implementation (see below)
  101. // for C++98 STL implementations.
  102. template <class T> class unique_ptr : public std::unique_ptr<T> {
  103. public:
  104. unique_ptr() {}
  105. explicit unique_ptr(T* p) : std::unique_ptr<T>(p) {}
  106. unique_ptr(std::unique_ptr<T>&& u) { *this = std::move(u); }
  107. unique_ptr(unique_ptr&& u) { *this = std::move(u); }
  108. unique_ptr& operator=(std::unique_ptr<T>&& u) {
  109. std::unique_ptr<T>::reset(u.release());
  110. return *this;
  111. }
  112. unique_ptr& operator=(unique_ptr&& u) {
  113. std::unique_ptr<T>::reset(u.release());
  114. return *this;
  115. }
  116. unique_ptr& operator=(T* p) {
  117. return std::unique_ptr<T>::operator=(p);
  118. }
  119. };
  120. #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
  121. #ifdef FLATBUFFERS_USE_STD_OPTIONAL
  122. template<class T>
  123. using Optional = std::optional<T>;
  124. using nullopt_t = std::nullopt_t;
  125. inline constexpr nullopt_t nullopt = std::nullopt;
  126. #else
  127. // Limited implementation of Optional<T> type for a scalar T.
  128. // This implementation limited by trivial types compatible with
  129. // std::is_arithmetic<T> or std::is_enum<T> type traits.
  130. // A tag to indicate an empty flatbuffers::optional<T>.
  131. struct nullopt_t {
  132. explicit FLATBUFFERS_CONSTEXPR_CPP11 nullopt_t(int) {}
  133. };
  134. #if defined(FLATBUFFERS_CONSTEXPR_DEFINED)
  135. namespace internal {
  136. template <class> struct nullopt_holder {
  137. static constexpr nullopt_t instance_ = nullopt_t(0);
  138. };
  139. template<class Dummy>
  140. constexpr nullopt_t nullopt_holder<Dummy>::instance_;
  141. }
  142. static constexpr const nullopt_t &nullopt = internal::nullopt_holder<void>::instance_;
  143. #else
  144. namespace internal {
  145. template <class> struct nullopt_holder {
  146. static const nullopt_t instance_;
  147. };
  148. template<class Dummy>
  149. const nullopt_t nullopt_holder<Dummy>::instance_ = nullopt_t(0);
  150. }
  151. static const nullopt_t &nullopt = internal::nullopt_holder<void>::instance_;
  152. #endif
  153. template<class T>
  154. class Optional FLATBUFFERS_FINAL_CLASS {
  155. // Non-scalar 'T' would extremely complicated Optional<T>.
  156. // Use is_scalar<T> checking because flatbuffers flatbuffers::is_arithmetic<T>
  157. // isn't implemented.
  158. static_assert(flatbuffers::is_scalar<T>::value, "unexpected type T");
  159. public:
  160. ~Optional() {}
  161. FLATBUFFERS_CONSTEXPR_CPP11 Optional() FLATBUFFERS_NOEXCEPT
  162. : value_(), has_value_(false) {}
  163. FLATBUFFERS_CONSTEXPR_CPP11 Optional(nullopt_t) FLATBUFFERS_NOEXCEPT
  164. : value_(), has_value_(false) {}
  165. FLATBUFFERS_CONSTEXPR_CPP11 Optional(T val) FLATBUFFERS_NOEXCEPT
  166. : value_(val), has_value_(true) {}
  167. FLATBUFFERS_CONSTEXPR_CPP11 Optional(const Optional &other) FLATBUFFERS_NOEXCEPT
  168. : value_(other.value_), has_value_(other.has_value_) {}
  169. FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(const Optional &other) FLATBUFFERS_NOEXCEPT {
  170. value_ = other.value_;
  171. has_value_ = other.has_value_;
  172. return *this;
  173. }
  174. FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(nullopt_t) FLATBUFFERS_NOEXCEPT {
  175. value_ = T();
  176. has_value_ = false;
  177. return *this;
  178. }
  179. FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(T val) FLATBUFFERS_NOEXCEPT {
  180. value_ = val;
  181. has_value_ = true;
  182. return *this;
  183. }
  184. void reset() FLATBUFFERS_NOEXCEPT {
  185. *this = nullopt;
  186. }
  187. void swap(Optional &other) FLATBUFFERS_NOEXCEPT {
  188. std::swap(value_, other.value_);
  189. std::swap(has_value_, other.has_value_);
  190. }
  191. FLATBUFFERS_CONSTEXPR_CPP11 FLATBUFFERS_EXPLICIT_CPP11 operator bool() const FLATBUFFERS_NOEXCEPT {
  192. return has_value_;
  193. }
  194. FLATBUFFERS_CONSTEXPR_CPP11 bool has_value() const FLATBUFFERS_NOEXCEPT {
  195. return has_value_;
  196. }
  197. FLATBUFFERS_CONSTEXPR_CPP11 const T& operator*() const FLATBUFFERS_NOEXCEPT {
  198. return value_;
  199. }
  200. const T& value() const {
  201. FLATBUFFERS_ASSERT(has_value());
  202. return value_;
  203. }
  204. T value_or(T default_value) const FLATBUFFERS_NOEXCEPT {
  205. return has_value() ? value_ : default_value;
  206. }
  207. private:
  208. T value_;
  209. bool has_value_;
  210. };
  211. template<class T>
  212. FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& opt, nullopt_t) FLATBUFFERS_NOEXCEPT {
  213. return !opt;
  214. }
  215. template<class T>
  216. FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(nullopt_t, const Optional<T>& opt) FLATBUFFERS_NOEXCEPT {
  217. return !opt;
  218. }
  219. template<class T, class U>
  220. FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& lhs, const U& rhs) FLATBUFFERS_NOEXCEPT {
  221. return static_cast<bool>(lhs) && (*lhs == rhs);
  222. }
  223. template<class T, class U>
  224. FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const T& lhs, const Optional<U>& rhs) FLATBUFFERS_NOEXCEPT {
  225. return static_cast<bool>(rhs) && (lhs == *rhs);
  226. }
  227. template<class T, class U>
  228. FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& lhs, const Optional<U>& rhs) FLATBUFFERS_NOEXCEPT {
  229. return static_cast<bool>(lhs) != static_cast<bool>(rhs)
  230. ? false
  231. : !static_cast<bool>(lhs) ? false : (*lhs == *rhs);
  232. }
  233. #endif // FLATBUFFERS_USE_STD_OPTIONAL
  234. // Very limited and naive partial implementation of C++20 std::span<T,Extent>.
  235. #if defined(FLATBUFFERS_USE_STD_SPAN)
  236. inline constexpr std::size_t dynamic_extent = std::dynamic_extent;
  237. template<class T, std::size_t Extent = std::dynamic_extent>
  238. using span = std::span<T, Extent>;
  239. #else // !defined(FLATBUFFERS_USE_STD_SPAN)
  240. FLATBUFFERS_CONSTEXPR std::size_t dynamic_extent = static_cast<std::size_t>(-1);
  241. // Exclude this code if MSVC2010 or non-STL Android is active.
  242. // The non-STL Android doesn't have `std::is_convertible` required for SFINAE.
  243. #if !defined(FLATBUFFERS_SPAN_MINIMAL)
  244. namespace internal {
  245. // This is SFINAE helper class for checking of a common condition:
  246. // > This overload only participates in overload resolution
  247. // > Check whether a pointer to an array of U can be converted
  248. // > to a pointer to an array of E.
  249. // This helper is used for checking of 'U -> const U'.
  250. template<class E, std::size_t Extent, class U, std::size_t N>
  251. struct is_span_convertable {
  252. using type =
  253. typename std::conditional<std::is_convertible<U (*)[], E (*)[]>::value
  254. && (Extent == dynamic_extent || N == Extent),
  255. int, void>::type;
  256. };
  257. template<typename T>
  258. struct SpanIterator {
  259. // TODO: upgrade to std::random_access_iterator_tag.
  260. using iterator_category = std::forward_iterator_tag;
  261. using difference_type = std::ptrdiff_t;
  262. using value_type = typename std::remove_cv<T>::type;
  263. using reference = T&;
  264. using pointer = T*;
  265. // Convince MSVC compiler that this iterator is trusted (it is verified).
  266. #ifdef _MSC_VER
  267. using _Unchecked_type = pointer;
  268. #endif // _MSC_VER
  269. SpanIterator(pointer ptr) : ptr_(ptr) {}
  270. reference operator*() const { return *ptr_; }
  271. pointer operator->() { return ptr_; }
  272. SpanIterator& operator++() { ptr_++; return *this; }
  273. SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; }
  274. friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; }
  275. friend bool operator!= (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ != rhs.ptr_; }
  276. private:
  277. pointer ptr_;
  278. };
  279. } // namespace internal
  280. #endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
  281. // T - element type; must be a complete type that is not an abstract
  282. // class type.
  283. // Extent - the number of elements in the sequence, or dynamic.
  284. template<class T, std::size_t Extent = dynamic_extent>
  285. class span FLATBUFFERS_FINAL_CLASS {
  286. public:
  287. typedef T element_type;
  288. typedef T& reference;
  289. typedef const T& const_reference;
  290. typedef T* pointer;
  291. typedef const T* const_pointer;
  292. typedef std::size_t size_type;
  293. static FLATBUFFERS_CONSTEXPR size_type extent = Extent;
  294. // Returns the number of elements in the span.
  295. FLATBUFFERS_CONSTEXPR_CPP11 size_type size() const FLATBUFFERS_NOEXCEPT {
  296. return count_;
  297. }
  298. // Returns the size of the sequence in bytes.
  299. FLATBUFFERS_CONSTEXPR_CPP11
  300. size_type size_bytes() const FLATBUFFERS_NOEXCEPT {
  301. return size() * sizeof(element_type);
  302. }
  303. // Checks if the span is empty.
  304. FLATBUFFERS_CONSTEXPR_CPP11 bool empty() const FLATBUFFERS_NOEXCEPT {
  305. return size() == 0;
  306. }
  307. // Returns a pointer to the beginning of the sequence.
  308. FLATBUFFERS_CONSTEXPR_CPP11 pointer data() const FLATBUFFERS_NOEXCEPT {
  309. return data_;
  310. }
  311. #if !defined(FLATBUFFERS_SPAN_MINIMAL)
  312. using Iterator = internal::SpanIterator<T>;
  313. using ConstIterator = internal::SpanIterator<const T>;
  314. Iterator begin() const { return Iterator(data()); }
  315. Iterator end() const { return Iterator(data() + size()); }
  316. ConstIterator cbegin() const { return ConstIterator(data()); }
  317. ConstIterator cend() const { return ConstIterator(data() + size()); }
  318. #endif
  319. // Returns a reference to the idx-th element of the sequence.
  320. // The behavior is undefined if the idx is greater than or equal to size().
  321. FLATBUFFERS_CONSTEXPR_CPP11 reference operator[](size_type idx) const {
  322. return data()[idx];
  323. }
  324. FLATBUFFERS_CONSTEXPR_CPP11 span(const span &other) FLATBUFFERS_NOEXCEPT
  325. : data_(other.data_), count_(other.count_) {}
  326. FLATBUFFERS_CONSTEXPR_CPP14 span &operator=(const span &other)
  327. FLATBUFFERS_NOEXCEPT {
  328. data_ = other.data_;
  329. count_ = other.count_;
  330. }
  331. // Limited implementation of
  332. // `template <class It> constexpr std::span(It first, size_type count);`.
  333. //
  334. // Constructs a span that is a view over the range [first, first + count);
  335. // the resulting span has: data() == first and size() == count.
  336. // The behavior is undefined if [first, first + count) is not a valid range,
  337. // or if (extent != flatbuffers::dynamic_extent && count != extent).
  338. FLATBUFFERS_CONSTEXPR_CPP11
  339. explicit span(pointer first, size_type count) FLATBUFFERS_NOEXCEPT
  340. : data_ (Extent == dynamic_extent ? first : (Extent == count ? first : nullptr)),
  341. count_(Extent == dynamic_extent ? count : (Extent == count ? Extent : 0)) {
  342. // Make span empty if the count argument is incompatible with span<T,N>.
  343. }
  344. // Exclude this code if MSVC2010 is active. The MSVC2010 isn't C++11
  345. // compliant, it doesn't support default template arguments for functions.
  346. #if defined(FLATBUFFERS_SPAN_MINIMAL)
  347. FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr),
  348. count_(0) {
  349. static_assert(extent == 0 || extent == dynamic_extent, "invalid span");
  350. }
  351. #else
  352. // Constructs an empty span whose data() == nullptr and size() == 0.
  353. // This overload only participates in overload resolution if
  354. // extent == 0 || extent == flatbuffers::dynamic_extent.
  355. // A dummy template argument N is need dependency for SFINAE.
  356. template<std::size_t N = 0,
  357. typename internal::is_span_convertable<element_type, Extent, element_type, (N - N)>::type = 0>
  358. FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr),
  359. count_(0) {
  360. static_assert(extent == 0 || extent == dynamic_extent, "invalid span");
  361. }
  362. // Constructs a span that is a view over the array arr; the resulting span
  363. // has size() == N and data() == std::data(arr). These overloads only
  364. // participate in overload resolution if
  365. // extent == std::dynamic_extent || N == extent is true and
  366. // std::remove_pointer_t<decltype(std::data(arr))>(*)[]
  367. // is convertible to element_type (*)[].
  368. template<std::size_t N,
  369. typename internal::is_span_convertable<element_type, Extent, element_type, N>::type = 0>
  370. FLATBUFFERS_CONSTEXPR_CPP11 span(element_type (&arr)[N]) FLATBUFFERS_NOEXCEPT
  371. : data_(arr), count_(N) {}
  372. template<class U, std::size_t N,
  373. typename internal::is_span_convertable<element_type, Extent, U, N>::type = 0>
  374. FLATBUFFERS_CONSTEXPR_CPP11 span(std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
  375. : data_(arr.data()), count_(N) {}
  376. //template<class U, std::size_t N,
  377. // int = 0>
  378. //FLATBUFFERS_CONSTEXPR_CPP11 span(std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
  379. // : data_(arr.data()), count_(N) {}
  380. template<class U, std::size_t N,
  381. typename internal::is_span_convertable<element_type, Extent, U, N>::type = 0>
  382. FLATBUFFERS_CONSTEXPR_CPP11 span(const std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
  383. : data_(arr.data()), count_(N) {}
  384. // Converting constructor from another span s;
  385. // the resulting span has size() == s.size() and data() == s.data().
  386. // This overload only participates in overload resolution
  387. // if extent == std::dynamic_extent || N == extent is true and U (*)[]
  388. // is convertible to element_type (*)[].
  389. template<class U, std::size_t N,
  390. typename internal::is_span_convertable<element_type, Extent, U, N>::type = 0>
  391. FLATBUFFERS_CONSTEXPR_CPP11 span(const flatbuffers::span<U, N> &s) FLATBUFFERS_NOEXCEPT
  392. : span(s.data(), s.size()) {
  393. }
  394. #endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
  395. private:
  396. // This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
  397. pointer const data_;
  398. const size_type count_;
  399. };
  400. #endif // defined(FLATBUFFERS_USE_STD_SPAN)
  401. #if !defined(FLATBUFFERS_SPAN_MINIMAL)
  402. template<class U, std::size_t N>
  403. FLATBUFFERS_CONSTEXPR_CPP11
  404. flatbuffers::span<U, N> make_span(U(&arr)[N]) FLATBUFFERS_NOEXCEPT {
  405. return span<U, N>(arr);
  406. }
  407. template<class U, std::size_t N>
  408. FLATBUFFERS_CONSTEXPR_CPP11
  409. flatbuffers::span<const U, N> make_span(const U(&arr)[N]) FLATBUFFERS_NOEXCEPT {
  410. return span<const U, N>(arr);
  411. }
  412. template<class U, std::size_t N>
  413. FLATBUFFERS_CONSTEXPR_CPP11
  414. flatbuffers::span<U, N> make_span(std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
  415. return span<U, N>(arr);
  416. }
  417. template<class U, std::size_t N>
  418. FLATBUFFERS_CONSTEXPR_CPP11
  419. flatbuffers::span<const U, N> make_span(const std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
  420. return span<const U, N>(arr);
  421. }
  422. template<class U, std::size_t N>
  423. FLATBUFFERS_CONSTEXPR_CPP11
  424. flatbuffers::span<U, dynamic_extent> make_span(U *first, std::size_t count) FLATBUFFERS_NOEXCEPT {
  425. return span<U, dynamic_extent>(first, count);
  426. }
  427. template<class U, std::size_t N>
  428. FLATBUFFERS_CONSTEXPR_CPP11
  429. flatbuffers::span<const U, dynamic_extent> make_span(const U *first, std::size_t count) FLATBUFFERS_NOEXCEPT {
  430. return span<const U, dynamic_extent>(first, count);
  431. }
  432. #endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
  433. } // namespace flatbuffers
  434. #endif // FLATBUFFERS_STL_EMULATION_H_