fixed_array.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. // Copyright 2018 The Abseil Authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // -----------------------------------------------------------------------------
  16. // File: fixed_array.h
  17. // -----------------------------------------------------------------------------
  18. //
  19. // A `FixedArray<T>` represents a non-resizable array of `T` where the length of
  20. // the array can be determined at run-time. It is a good replacement for
  21. // non-standard and deprecated uses of `alloca()` and variable length arrays
  22. // within the GCC extension. (See
  23. // https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html).
  24. //
  25. // `FixedArray` allocates small arrays inline, keeping performance fast by
  26. // avoiding heap operations. It also helps reduce the chances of
  27. // accidentally overflowing your stack if large input is passed to
  28. // your function.
  29. #ifndef ABSL_CONTAINER_FIXED_ARRAY_H_
  30. #define ABSL_CONTAINER_FIXED_ARRAY_H_
  31. #include <algorithm>
  32. #include <cassert>
  33. #include <cstddef>
  34. #include <initializer_list>
  35. #include <iterator>
  36. #include <limits>
  37. #include <memory>
  38. #include <new>
  39. #include <type_traits>
  40. #include "absl/algorithm/algorithm.h"
  41. #include "absl/base/attributes.h"
  42. #include "absl/base/config.h"
  43. #include "absl/base/dynamic_annotations.h"
  44. #include "absl/base/internal/throw_delegate.h"
  45. #include "absl/base/macros.h"
  46. #include "absl/base/optimization.h"
  47. #include "absl/base/port.h"
  48. #include "absl/container/internal/compressed_tuple.h"
  49. #include "absl/memory/memory.h"
  50. namespace absl {
  51. ABSL_NAMESPACE_BEGIN
  52. constexpr static auto kFixedArrayUseDefault = static_cast<size_t>(-1);
  53. // -----------------------------------------------------------------------------
  54. // FixedArray
  55. // -----------------------------------------------------------------------------
  56. //
  57. // A `FixedArray` provides a run-time fixed-size array, allocating a small array
  58. // inline for efficiency.
  59. //
  60. // Most users should not specify the `N` template parameter and let `FixedArray`
  61. // automatically determine the number of elements to store inline based on
  62. // `sizeof(T)`. If `N` is specified, the `FixedArray` implementation will use
  63. // inline storage for arrays with a length <= `N`.
  64. //
  65. // Note that a `FixedArray` constructed with a `size_type` argument will
  66. // default-initialize its values by leaving trivially constructible types
  67. // uninitialized (e.g. int, int[4], double), and others default-constructed.
  68. // This matches the behavior of c-style arrays and `std::array`, but not
  69. // `std::vector`.
  70. template <typename T, size_t N = kFixedArrayUseDefault,
  71. typename A = std::allocator<T>>
  72. class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray {
  73. static_assert(!std::is_array<T>::value || std::extent<T>::value > 0,
  74. "Arrays with unknown bounds cannot be used with FixedArray.");
  75. static constexpr size_t kInlineBytesDefault = 256;
  76. using AllocatorTraits = std::allocator_traits<A>;
  77. // std::iterator_traits isn't guaranteed to be SFINAE-friendly until C++17,
  78. // but this seems to be mostly pedantic.
  79. template <typename Iterator>
  80. using EnableIfForwardIterator = absl::enable_if_t<std::is_convertible<
  81. typename std::iterator_traits<Iterator>::iterator_category,
  82. std::forward_iterator_tag>::value>;
  83. static constexpr bool NoexceptCopyable() {
  84. return std::is_nothrow_copy_constructible<StorageElement>::value &&
  85. absl::allocator_is_nothrow<allocator_type>::value;
  86. }
  87. static constexpr bool NoexceptMovable() {
  88. return std::is_nothrow_move_constructible<StorageElement>::value &&
  89. absl::allocator_is_nothrow<allocator_type>::value;
  90. }
  91. static constexpr bool DefaultConstructorIsNonTrivial() {
  92. return !absl::is_trivially_default_constructible<StorageElement>::value;
  93. }
  94. public:
  95. using allocator_type = typename AllocatorTraits::allocator_type;
  96. using value_type = typename AllocatorTraits::value_type;
  97. using pointer = typename AllocatorTraits::pointer;
  98. using const_pointer = typename AllocatorTraits::const_pointer;
  99. using reference = value_type&;
  100. using const_reference = const value_type&;
  101. using size_type = typename AllocatorTraits::size_type;
  102. using difference_type = typename AllocatorTraits::difference_type;
  103. using iterator = pointer;
  104. using const_iterator = const_pointer;
  105. using reverse_iterator = std::reverse_iterator<iterator>;
  106. using const_reverse_iterator = std::reverse_iterator<const_iterator>;
  107. static constexpr size_type inline_elements =
  108. (N == kFixedArrayUseDefault ? kInlineBytesDefault / sizeof(value_type)
  109. : static_cast<size_type>(N));
  110. FixedArray(const FixedArray& other) noexcept(NoexceptCopyable())
  111. : FixedArray(other,
  112. AllocatorTraits::select_on_container_copy_construction(
  113. other.storage_.alloc())) {}
  114. FixedArray(const FixedArray& other,
  115. const allocator_type& a) noexcept(NoexceptCopyable())
  116. : FixedArray(other.begin(), other.end(), a) {}
  117. FixedArray(FixedArray&& other) noexcept(NoexceptMovable())
  118. : FixedArray(std::move(other), other.storage_.alloc()) {}
  119. FixedArray(FixedArray&& other,
  120. const allocator_type& a) noexcept(NoexceptMovable())
  121. : FixedArray(std::make_move_iterator(other.begin()),
  122. std::make_move_iterator(other.end()), a) {}
  123. // Creates an array object that can store `n` elements.
  124. // Note that trivially constructible elements will be uninitialized.
  125. explicit FixedArray(size_type n, const allocator_type& a = allocator_type())
  126. : storage_(n, a) {
  127. if (DefaultConstructorIsNonTrivial()) {
  128. memory_internal::ConstructRange(storage_.alloc(), storage_.begin(),
  129. storage_.end());
  130. }
  131. }
  132. // Creates an array initialized with `n` copies of `val`.
  133. FixedArray(size_type n, const value_type& val,
  134. const allocator_type& a = allocator_type())
  135. : storage_(n, a) {
  136. memory_internal::ConstructRange(storage_.alloc(), storage_.begin(),
  137. storage_.end(), val);
  138. }
  139. // Creates an array initialized with the size and contents of `init_list`.
  140. FixedArray(std::initializer_list<value_type> init_list,
  141. const allocator_type& a = allocator_type())
  142. : FixedArray(init_list.begin(), init_list.end(), a) {}
  143. // Creates an array initialized with the elements from the input
  144. // range. The array's size will always be `std::distance(first, last)`.
  145. // REQUIRES: Iterator must be a forward_iterator or better.
  146. template <typename Iterator, EnableIfForwardIterator<Iterator>* = nullptr>
  147. FixedArray(Iterator first, Iterator last,
  148. const allocator_type& a = allocator_type())
  149. : storage_(std::distance(first, last), a) {
  150. memory_internal::CopyRange(storage_.alloc(), storage_.begin(), first, last);
  151. }
  152. ~FixedArray() noexcept {
  153. for (auto* cur = storage_.begin(); cur != storage_.end(); ++cur) {
  154. AllocatorTraits::destroy(storage_.alloc(), cur);
  155. }
  156. }
  157. // Assignments are deleted because they break the invariant that the size of a
  158. // `FixedArray` never changes.
  159. void operator=(FixedArray&&) = delete;
  160. void operator=(const FixedArray&) = delete;
  161. // FixedArray::size()
  162. //
  163. // Returns the length of the fixed array.
  164. size_type size() const { return storage_.size(); }
  165. // FixedArray::max_size()
  166. //
  167. // Returns the largest possible value of `std::distance(begin(), end())` for a
  168. // `FixedArray<T>`. This is equivalent to the most possible addressable bytes
  169. // over the number of bytes taken by T.
  170. constexpr size_type max_size() const {
  171. return (std::numeric_limits<difference_type>::max)() / sizeof(value_type);
  172. }
  173. // FixedArray::empty()
  174. //
  175. // Returns whether or not the fixed array is empty.
  176. bool empty() const { return size() == 0; }
  177. // FixedArray::memsize()
  178. //
  179. // Returns the memory size of the fixed array in bytes.
  180. size_t memsize() const { return size() * sizeof(value_type); }
  181. // FixedArray::data()
  182. //
  183. // Returns a const T* pointer to elements of the `FixedArray`. This pointer
  184. // can be used to access (but not modify) the contained elements.
  185. const_pointer data() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  186. return AsValueType(storage_.begin());
  187. }
  188. // Overload of FixedArray::data() to return a T* pointer to elements of the
  189. // fixed array. This pointer can be used to access and modify the contained
  190. // elements.
  191. pointer data() ABSL_ATTRIBUTE_LIFETIME_BOUND {
  192. return AsValueType(storage_.begin());
  193. }
  194. // FixedArray::operator[]
  195. //
  196. // Returns a reference the ith element of the fixed array.
  197. // REQUIRES: 0 <= i < size()
  198. reference operator[](size_type i) ABSL_ATTRIBUTE_LIFETIME_BOUND {
  199. ABSL_HARDENING_ASSERT(i < size());
  200. return data()[i];
  201. }
  202. // Overload of FixedArray::operator()[] to return a const reference to the
  203. // ith element of the fixed array.
  204. // REQUIRES: 0 <= i < size()
  205. const_reference operator[](size_type i) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  206. ABSL_HARDENING_ASSERT(i < size());
  207. return data()[i];
  208. }
  209. // FixedArray::at
  210. //
  211. // Bounds-checked access. Returns a reference to the ith element of the fixed
  212. // array, or throws std::out_of_range
  213. reference at(size_type i) ABSL_ATTRIBUTE_LIFETIME_BOUND {
  214. if (ABSL_PREDICT_FALSE(i >= size())) {
  215. base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check");
  216. }
  217. return data()[i];
  218. }
  219. // Overload of FixedArray::at() to return a const reference to the ith element
  220. // of the fixed array.
  221. const_reference at(size_type i) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  222. if (ABSL_PREDICT_FALSE(i >= size())) {
  223. base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check");
  224. }
  225. return data()[i];
  226. }
  227. // FixedArray::front()
  228. //
  229. // Returns a reference to the first element of the fixed array.
  230. reference front() ABSL_ATTRIBUTE_LIFETIME_BOUND {
  231. ABSL_HARDENING_ASSERT(!empty());
  232. return data()[0];
  233. }
  234. // Overload of FixedArray::front() to return a reference to the first element
  235. // of a fixed array of const values.
  236. const_reference front() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  237. ABSL_HARDENING_ASSERT(!empty());
  238. return data()[0];
  239. }
  240. // FixedArray::back()
  241. //
  242. // Returns a reference to the last element of the fixed array.
  243. reference back() ABSL_ATTRIBUTE_LIFETIME_BOUND {
  244. ABSL_HARDENING_ASSERT(!empty());
  245. return data()[size() - 1];
  246. }
  247. // Overload of FixedArray::back() to return a reference to the last element
  248. // of a fixed array of const values.
  249. const_reference back() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  250. ABSL_HARDENING_ASSERT(!empty());
  251. return data()[size() - 1];
  252. }
  253. // FixedArray::begin()
  254. //
  255. // Returns an iterator to the beginning of the fixed array.
  256. iterator begin() ABSL_ATTRIBUTE_LIFETIME_BOUND { return data(); }
  257. // Overload of FixedArray::begin() to return a const iterator to the
  258. // beginning of the fixed array.
  259. const_iterator begin() const ABSL_ATTRIBUTE_LIFETIME_BOUND { return data(); }
  260. // FixedArray::cbegin()
  261. //
  262. // Returns a const iterator to the beginning of the fixed array.
  263. const_iterator cbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  264. return begin();
  265. }
  266. // FixedArray::end()
  267. //
  268. // Returns an iterator to the end of the fixed array.
  269. iterator end() ABSL_ATTRIBUTE_LIFETIME_BOUND { return data() + size(); }
  270. // Overload of FixedArray::end() to return a const iterator to the end of the
  271. // fixed array.
  272. const_iterator end() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  273. return data() + size();
  274. }
  275. // FixedArray::cend()
  276. //
  277. // Returns a const iterator to the end of the fixed array.
  278. const_iterator cend() const ABSL_ATTRIBUTE_LIFETIME_BOUND { return end(); }
  279. // FixedArray::rbegin()
  280. //
  281. // Returns a reverse iterator from the end of the fixed array.
  282. reverse_iterator rbegin() ABSL_ATTRIBUTE_LIFETIME_BOUND {
  283. return reverse_iterator(end());
  284. }
  285. // Overload of FixedArray::rbegin() to return a const reverse iterator from
  286. // the end of the fixed array.
  287. const_reverse_iterator rbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  288. return const_reverse_iterator(end());
  289. }
  290. // FixedArray::crbegin()
  291. //
  292. // Returns a const reverse iterator from the end of the fixed array.
  293. const_reverse_iterator crbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  294. return rbegin();
  295. }
  296. // FixedArray::rend()
  297. //
  298. // Returns a reverse iterator from the beginning of the fixed array.
  299. reverse_iterator rend() ABSL_ATTRIBUTE_LIFETIME_BOUND {
  300. return reverse_iterator(begin());
  301. }
  302. // Overload of FixedArray::rend() for returning a const reverse iterator
  303. // from the beginning of the fixed array.
  304. const_reverse_iterator rend() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  305. return const_reverse_iterator(begin());
  306. }
  307. // FixedArray::crend()
  308. //
  309. // Returns a reverse iterator from the beginning of the fixed array.
  310. const_reverse_iterator crend() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
  311. return rend();
  312. }
  313. // FixedArray::fill()
  314. //
  315. // Assigns the given `value` to all elements in the fixed array.
  316. void fill(const value_type& val) { std::fill(begin(), end(), val); }
  317. // Relational operators. Equality operators are elementwise using
  318. // `operator==`, while order operators order FixedArrays lexicographically.
  319. friend bool operator==(const FixedArray& lhs, const FixedArray& rhs) {
  320. return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
  321. }
  322. friend bool operator!=(const FixedArray& lhs, const FixedArray& rhs) {
  323. return !(lhs == rhs);
  324. }
  325. friend bool operator<(const FixedArray& lhs, const FixedArray& rhs) {
  326. return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(),
  327. rhs.end());
  328. }
  329. friend bool operator>(const FixedArray& lhs, const FixedArray& rhs) {
  330. return rhs < lhs;
  331. }
  332. friend bool operator<=(const FixedArray& lhs, const FixedArray& rhs) {
  333. return !(rhs < lhs);
  334. }
  335. friend bool operator>=(const FixedArray& lhs, const FixedArray& rhs) {
  336. return !(lhs < rhs);
  337. }
  338. template <typename H>
  339. friend H AbslHashValue(H h, const FixedArray& v) {
  340. return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()),
  341. v.size());
  342. }
  343. private:
  344. // StorageElement
  345. //
  346. // For FixedArrays with a C-style-array value_type, StorageElement is a POD
  347. // wrapper struct called StorageElementWrapper that holds the value_type
  348. // instance inside. This is needed for construction and destruction of the
  349. // entire array regardless of how many dimensions it has. For all other cases,
  350. // StorageElement is just an alias of value_type.
  351. //
  352. // Maintainer's Note: The simpler solution would be to simply wrap value_type
  353. // in a struct whether it's an array or not. That causes some paranoid
  354. // diagnostics to misfire, believing that 'data()' returns a pointer to a
  355. // single element, rather than the packed array that it really is.
  356. // e.g.:
  357. //
  358. // FixedArray<char> buf(1);
  359. // sprintf(buf.data(), "foo");
  360. //
  361. // error: call to int __builtin___sprintf_chk(etc...)
  362. // will always overflow destination buffer [-Werror]
  363. //
  364. template <typename OuterT, typename InnerT = absl::remove_extent_t<OuterT>,
  365. size_t InnerN = std::extent<OuterT>::value>
  366. struct StorageElementWrapper {
  367. InnerT array[InnerN];
  368. };
  369. using StorageElement =
  370. absl::conditional_t<std::is_array<value_type>::value,
  371. StorageElementWrapper<value_type>, value_type>;
  372. static pointer AsValueType(pointer ptr) { return ptr; }
  373. static pointer AsValueType(StorageElementWrapper<value_type>* ptr) {
  374. return std::addressof(ptr->array);
  375. }
  376. static_assert(sizeof(StorageElement) == sizeof(value_type), "");
  377. static_assert(alignof(StorageElement) == alignof(value_type), "");
  378. class NonEmptyInlinedStorage {
  379. public:
  380. StorageElement* data() { return reinterpret_cast<StorageElement*>(buff_); }
  381. void AnnotateConstruct(size_type n);
  382. void AnnotateDestruct(size_type n);
  383. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  384. void* RedzoneBegin() { return &redzone_begin_; }
  385. void* RedzoneEnd() { return &redzone_end_ + 1; }
  386. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  387. private:
  388. ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_);
  389. alignas(StorageElement) char buff_[sizeof(StorageElement[inline_elements])];
  390. ABSL_ADDRESS_SANITIZER_REDZONE(redzone_end_);
  391. };
  392. class EmptyInlinedStorage {
  393. public:
  394. StorageElement* data() { return nullptr; }
  395. void AnnotateConstruct(size_type) {}
  396. void AnnotateDestruct(size_type) {}
  397. };
  398. using InlinedStorage =
  399. absl::conditional_t<inline_elements == 0, EmptyInlinedStorage,
  400. NonEmptyInlinedStorage>;
  401. // Storage
  402. //
  403. // An instance of Storage manages the inline and out-of-line memory for
  404. // instances of FixedArray. This guarantees that even when construction of
  405. // individual elements fails in the FixedArray constructor body, the
  406. // destructor for Storage will still be called and out-of-line memory will be
  407. // properly deallocated.
  408. //
  409. class Storage : public InlinedStorage {
  410. public:
  411. Storage(size_type n, const allocator_type& a)
  412. : size_alloc_(n, a), data_(InitializeData()) {}
  413. ~Storage() noexcept {
  414. if (UsingInlinedStorage(size())) {
  415. InlinedStorage::AnnotateDestruct(size());
  416. } else {
  417. AllocatorTraits::deallocate(alloc(), AsValueType(begin()), size());
  418. }
  419. }
  420. size_type size() const { return size_alloc_.template get<0>(); }
  421. StorageElement* begin() const { return data_; }
  422. StorageElement* end() const { return begin() + size(); }
  423. allocator_type& alloc() { return size_alloc_.template get<1>(); }
  424. const allocator_type& alloc() const {
  425. return size_alloc_.template get<1>();
  426. }
  427. private:
  428. static bool UsingInlinedStorage(size_type n) {
  429. return n <= inline_elements;
  430. }
  431. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  432. ABSL_ATTRIBUTE_NOINLINE
  433. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  434. StorageElement* InitializeData() {
  435. if (UsingInlinedStorage(size())) {
  436. InlinedStorage::AnnotateConstruct(size());
  437. return InlinedStorage::data();
  438. } else {
  439. return reinterpret_cast<StorageElement*>(
  440. AllocatorTraits::allocate(alloc(), size()));
  441. }
  442. }
  443. // `CompressedTuple` takes advantage of EBCO for stateless `allocator_type`s
  444. container_internal::CompressedTuple<size_type, allocator_type> size_alloc_;
  445. StorageElement* data_;
  446. };
  447. Storage storage_;
  448. };
  449. #ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
  450. template <typename T, size_t N, typename A>
  451. constexpr size_t FixedArray<T, N, A>::kInlineBytesDefault;
  452. template <typename T, size_t N, typename A>
  453. constexpr typename FixedArray<T, N, A>::size_type
  454. FixedArray<T, N, A>::inline_elements;
  455. #endif
  456. template <typename T, size_t N, typename A>
  457. void FixedArray<T, N, A>::NonEmptyInlinedStorage::AnnotateConstruct(
  458. typename FixedArray<T, N, A>::size_type n) {
  459. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  460. if (!n) return;
  461. ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), RedzoneEnd(),
  462. data() + n);
  463. ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), data(),
  464. RedzoneBegin());
  465. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  466. static_cast<void>(n); // Mark used when not in asan mode
  467. }
  468. template <typename T, size_t N, typename A>
  469. void FixedArray<T, N, A>::NonEmptyInlinedStorage::AnnotateDestruct(
  470. typename FixedArray<T, N, A>::size_type n) {
  471. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  472. if (!n) return;
  473. ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), data() + n,
  474. RedzoneEnd());
  475. ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), RedzoneBegin(),
  476. data());
  477. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  478. static_cast<void>(n); // Mark used when not in asan mode
  479. }
  480. ABSL_NAMESPACE_END
  481. } // namespace absl
  482. #endif // ABSL_CONTAINER_FIXED_ARRAY_H_