|
| 1 | +///////////////////////// ankerl::unordered_dense::{map, set} ///////////////////////// |
| 2 | + |
| 3 | +// A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion. |
| 4 | +// Version 4.5.0 |
| 5 | +// https://github.com/martinus/unordered_dense |
| 6 | +// |
| 7 | +// Licensed under the MIT License <http://opensource.org/licenses/MIT>. |
| 8 | +// SPDX-License-Identifier: MIT |
| 9 | +// Copyright (c) 2022-2024 Martin Leitner-Ankerl <[email protected]> |
| 10 | +// |
| 11 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 12 | +// of this software and associated documentation files (the "Software"), to deal |
| 13 | +// in the Software without restriction, including without limitation the rights |
| 14 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 15 | +// copies of the Software, and to permit persons to whom the Software is |
| 16 | +// furnished to do so, subject to the following conditions: |
| 17 | +// |
| 18 | +// The above copyright notice and this permission notice shall be included in all |
| 19 | +// copies or substantial portions of the Software. |
| 20 | +// |
| 21 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 22 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 23 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 24 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 25 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 26 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 27 | +// SOFTWARE. |
| 28 | + |
| 29 | +#ifndef ANKERL_STL_H |
| 30 | +#define ANKERL_STL_H |
| 31 | + |
| 32 | +#include <array> // for array |
| 33 | +#include <cstdint> // for uint64_t, uint32_t, std::uint8_t, UINT64_C |
| 34 | +#include <cstring> // for size_t, memcpy, memset |
| 35 | +#include <functional> // for equal_to, hash |
| 36 | +#include <initializer_list> // for initializer_list |
| 37 | +#include <iterator> // for pair, distance |
| 38 | +#include <limits> // for numeric_limits |
| 39 | +#include <memory> // for allocator, allocator_traits, shared_ptr |
| 40 | +#include <optional> // for optional |
| 41 | +#include <stdexcept> // for out_of_range |
| 42 | +#include <string> // for basic_string |
| 43 | +#include <string_view> // for basic_string_view, hash |
| 44 | +#include <tuple> // for forward_as_tuple |
| 45 | +#include <type_traits> // for enable_if_t, declval, conditional_t, ena... |
| 46 | +#include <utility> // for forward, exchange, pair, as_const, piece... |
| 47 | +#include <vector> // for vector |
| 48 | +#if ANKERL_UNORDERED_DENSE_HAS_EXCEPTIONS() == 0 |
| 49 | +# include <cstdlib> // for abort |
| 50 | +#endif |
| 51 | + |
| 52 | +#if defined(__has_include) |
| 53 | +# if __has_include(<memory_resource>) |
| 54 | +# define ANKERL_UNORDERED_DENSE_PMR std::pmr // NOLINT(cppcoreguidelines-macro-usage) |
| 55 | +# include <memory_resource> // for polymorphic_allocator |
| 56 | +# elif __has_include(<experimental/memory_resource>) |
| 57 | +# define ANKERL_UNORDERED_DENSE_PMR std::experimental::pmr // NOLINT(cppcoreguidelines-macro-usage) |
| 58 | +# include <experimental/memory_resource> // for polymorphic_allocator |
| 59 | +# endif |
| 60 | +#endif |
| 61 | + |
| 62 | +#if defined(_MSC_VER) && defined(_M_X64) |
| 63 | +# include <intrin.h> |
| 64 | +# pragma intrinsic(_umul128) |
| 65 | +#endif |
| 66 | + |
| 67 | +#endif |
0 commit comments