Go to the documentation of this file.
30 #ifndef ABSL_CONTAINER_FIXED_ARRAY_H_
31 #define ABSL_CONTAINER_FIXED_ARRAY_H_
36 #include <initializer_list>
41 #include <type_traits>
43 #include "absl/algorithm/algorithm.h"
44 #include "absl/base/config.h"
45 #include "absl/base/dynamic_annotations.h"
46 #include "absl/base/internal/throw_delegate.h"
47 #include "absl/base/macros.h"
48 #include "absl/base/optimization.h"
49 #include "absl/base/port.h"
50 #include "absl/container/internal/compressed_tuple.h"
51 #include "absl/memory/memory.h"
77 typename A = std::allocator<T>>
80 "Arrays with unknown bounds cannot be used with FixedArray.");
87 template <
typename Iterator>
89 typename std::iterator_traits<Iterator>::iterator_category,
106 using pointer =
typename AllocatorTraits::pointer;
130 std::make_move_iterator(other.
end()), a) {}
158 template <
typename Iterator, EnableIfForwardIterator<Iterator>* =
nullptr>
350 return !(lhs == rhs);
354 return std::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(),
370 template <
typename H>
372 return H::combine(H::combine_contiguous(
std::move(h),
v.data(),
v.size()),
397 template <
typename OuterT,
typename InnerT = absl::remove_extent_t<OuterT>,
398 size_t InnerN = std::extent<OuterT>::value>
409 return std::addressof(
ptr->array);
421 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
422 void* RedzoneBegin() {
return &redzone_begin_; }
423 void* RedzoneEnd() {
return &redzone_end_ + 1; }
424 #endif // ABSL_HAVE_ADDRESS_SANITIZER
458 InlinedStorage::AnnotateDestruct(
size());
476 InlinedStorage::AnnotateConstruct(
size());
480 AllocatorTraits::allocate(
alloc(),
size()));
492 #ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
493 template <
typename T,
size_t N,
typename A>
496 template <
typename T,
size_t N,
typename A>
501 template <
typename T,
size_t N,
typename A>
504 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
510 #endif // ABSL_HAVE_ADDRESS_SANITIZER
511 static_cast<void>(
n);
514 template <
typename T,
size_t N,
typename A>
517 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
523 #endif // ABSL_HAVE_ADDRESS_SANITIZER
524 static_cast<void>(
n);
529 #endif // ABSL_CONTAINER_FIXED_ARRAY_H_
#define ABSL_PREDICT_FALSE(x)
const value_type & const_reference
void AnnotateDestruct(size_type)
const_reverse_iterator rbegin() const
static constexpr bool NoexceptMovable()
const_reference operator[](size_type i) const
typename AllocatorTraits::const_pointer const_pointer
Storage(size_type n, const allocator_type &a)
#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid)
const_reverse_iterator crend() const
void fill(const value_type &val)
const_iterator end() const
typename std::conditional< B, T, F >::type conditional_t
typename AllocatorTraits::value_type value_type
const_reference back() const
std::reverse_iterator< iterator > reverse_iterator
constexpr size_type max_size() const
FixedArray(size_type n, const allocator_type &a=allocator_type())
StorageElement * InitializeData()
void CopyRange(Allocator &alloc, Iterator destination, InputIterator first, InputIterator last)
friend bool operator==(const FixedArray &lhs, const FixedArray &rhs)
reference at(size_type i)
typename std::enable_if< B, T >::type enable_if_t
static bool UsingInlinedStorage(size_type n)
friend bool operator>=(const FixedArray &lhs, const FixedArray &rhs)
const_iterator cend() const
typename AllocatorTraits::difference_type difference_type
const_iterator begin() const
FixedArray(const FixedArray &other, const allocator_type &a=allocator_type()) noexcept(NoexceptCopyable())
#define ABSL_NAMESPACE_END
FixedArray(FixedArray &&other, const allocator_type &a=allocator_type()) noexcept(NoexceptMovable())
char buff_[sizeof(StorageElement[inline_elements])]
StorageElement * end() const
#define ABSL_HARDENING_ASSERT(expr)
#define T(upbtypeconst, upbtype, ctype, default_value)
ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_)
static constexpr bool DefaultConstructorIsNonTrivial()
friend bool operator<(const FixedArray &lhs, const FixedArray &rhs)
constexpr static ABSL_NAMESPACE_BEGIN auto kFixedArrayUseDefault
void AnnotateConstruct(size_type)
reverse_iterator rbegin()
void ThrowStdOutOfRange(const std::string &what_arg)
const_reverse_iterator rend() const
#define ABSL_NAMESPACE_BEGIN
const_pointer data() const
static pointer AsValueType(StorageElementWrapper< value_type > *ptr)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
std::allocator_traits< A > AllocatorTraits
friend bool operator<=(const FixedArray &lhs, const FixedArray &rhs)
const_pointer const_iterator
absl::conditional_t< std::is_array< value_type >::value, StorageElementWrapper< value_type >, value_type > StorageElement
static constexpr size_t kInlineBytesDefault
const_reference front() const
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred &&pred)
absl::enable_if_t< std::is_convertible< typename std::iterator_traits< Iterator >::iterator_category, std::forward_iterator_tag >::value > EnableIfForwardIterator
typename AllocatorTraits::pointer pointer
static constexpr size_type inline_elements
const_reverse_iterator crbegin() const
absl::conditional_t< inline_elements==0, EmptyInlinedStorage, NonEmptyInlinedStorage > InlinedStorage
FixedArray(std::initializer_list< value_type > init_list, const allocator_type &a=allocator_type())
const_iterator cbegin() const
void ConstructRange(Allocator &alloc, Iterator first, Iterator last, const Args &... args)
FixedArray(size_type n, const value_type &val, const allocator_type &a=allocator_type())
std::reverse_iterator< const_iterator > const_reverse_iterator
friend H AbslHashValue(H h, const FixedArray &v)
typename AllocatorTraits::allocator_type allocator_type
const_reference at(size_type i) const
FixedArray(Iterator first, Iterator last, const allocator_type &a=allocator_type())
friend bool operator>(const FixedArray &lhs, const FixedArray &rhs)
friend bool operator!=(const FixedArray &lhs, const FixedArray &rhs)
container_internal::CompressedTuple< size_type, allocator_type > size_alloc_
static constexpr bool NoexceptCopyable()
void AnnotateDestruct(size_type n)
void operator=(FixedArray &&)=delete
reference operator[](size_type i)
static pointer AsValueType(pointer ptr)
void AnnotateConstruct(size_type n)
static std::function< void(void *, Slot *)> destroy
StorageElement * begin() const
const typedef T * const_pointer
typename AllocatorTraits::size_type size_type
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:23