Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/__hash_table
// -*- C++ -*- | // -*- C++ -*- | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef _LIBCPP___HASH_TABLE | #ifndef _LIBCPP___HASH_TABLE | ||||
#define _LIBCPP___HASH_TABLE | #define _LIBCPP___HASH_TABLE | ||||
#include <__algorithm/max.h> | #include <__algorithm/max.h> | ||||
#include <__algorithm/min.h> | #include <__algorithm/min.h> | ||||
#include <__assert> | #include <__assert> | ||||
#include <__bits> // __libcpp_clz | #include <__bits> // __libcpp_clz | ||||
#include <__cmath/rounding.h> | |||||
#include <__config> | #include <__config> | ||||
#include <__debug> | #include <__debug> | ||||
#include <__functional/hash.h> | #include <__functional/hash.h> | ||||
#include <__iterator/iterator_traits.h> | #include <__iterator/iterator_traits.h> | ||||
#include <__memory/addressof.h> | #include <__memory/addressof.h> | ||||
#include <__memory/allocator_traits.h> | #include <__memory/allocator_traits.h> | ||||
#include <__memory/compressed_pair.h> | #include <__memory/compressed_pair.h> | ||||
#include <__memory/pointer_traits.h> | #include <__memory/pointer_traits.h> | ||||
#include <__memory/swap_allocator.h> | #include <__memory/swap_allocator.h> | ||||
#include <__memory/unique_ptr.h> | #include <__memory/unique_ptr.h> | ||||
#include <__type_traits/can_extract_key.h> | #include <__type_traits/can_extract_key.h> | ||||
#include <__utility/forward.h> | #include <__utility/forward.h> | ||||
#include <__utility/move.h> | #include <__utility/move.h> | ||||
#include <__utility/pair.h> | #include <__utility/pair.h> | ||||
#include <__utility/swap.h> | #include <__utility/swap.h> | ||||
#include <cmath> | |||||
#include <cstring> | #include <cstring> | ||||
#include <initializer_list> | #include <initializer_list> | ||||
#include <limits> | |||||
#include <type_traits> | #include <type_traits> | ||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||||
# pragma GCC system_header | # pragma GCC system_header | ||||
#endif | #endif | ||||
_LIBCPP_PUSH_MACROS | _LIBCPP_PUSH_MACROS | ||||
#include <__undef_macros> | #include <__undef_macros> | ||||
▲ Show 20 Lines • Show All 1,109 Lines • ▼ Show 20 Lines | #if _LIBCPP_STD_VER > 14 | ||||
_NodeHandle __node_handle_extract(const_iterator __it); | _NodeHandle __node_handle_extract(const_iterator __it); | ||||
#endif | #endif | ||||
void clear() _NOEXCEPT; | void clear() _NOEXCEPT; | ||||
_LIBCPP_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash<true>(__n); } | _LIBCPP_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash<true>(__n); } | ||||
_LIBCPP_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash<false>(__n); } | _LIBCPP_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash<false>(__n); } | ||||
_LIBCPP_INLINE_VISIBILITY void __reserve_unique(size_type __n) | _LIBCPP_INLINE_VISIBILITY void __reserve_unique(size_type __n) | ||||
{ | { | ||||
__rehash_unique(static_cast<size_type>(ceil(__n / max_load_factor()))); | __rehash_unique(static_cast<size_type>(std::ceil(__n / max_load_factor()))); | ||||
} | } | ||||
_LIBCPP_INLINE_VISIBILITY void __reserve_multi(size_type __n) | _LIBCPP_INLINE_VISIBILITY void __reserve_multi(size_type __n) | ||||
{ | { | ||||
__rehash_multi(static_cast<size_type>(ceil(__n / max_load_factor()))); | __rehash_multi(static_cast<size_type>(std::ceil(__n / max_load_factor()))); | ||||
} | } | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
size_type bucket_count() const _NOEXCEPT | size_type bucket_count() const _NOEXCEPT | ||||
{ | { | ||||
return __bucket_list_.get_deleter().size(); | return __bucket_list_.get_deleter().size(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,544 Lines • Show Last 20 Lines |