@@ -126,10 +126,8 @@ static Counts & counts()
126
126
// bitness
127
127
#if SIZE_MAX == UINT32_MAX
128
128
#define ROBIN_HOOD_PRIVATE_DEFINITION_BITNESS () 32
129
- #elif SIZE_MAX == UINT64_MAX
130
- #define ROBIN_HOOD_PRIVATE_DEFINITION_BITNESS () 64
131
129
#else
132
- #error Unsupported bitness
130
+ #define ROBIN_HOOD_PRIVATE_DEFINITION_BITNESS () 64
133
131
#endif
134
132
135
133
// endianess
@@ -165,12 +163,13 @@ static Counts & counts()
165
163
#endif
166
164
#include < intrin.h>
167
165
#pragma intrinsic(ROBIN_HOOD(BITSCANFORWARD))
168
- #define ROBIN_HOOD_COUNT_TRAILING_ZEROES (x ) \
169
- [](size_t mask) noexcept -> int { \
170
- unsigned long index ; \ // NOLINT
171
- return ROBIN_HOOD (BITSCANFORWARD)(&index , mask) ? static_cast <int >(index ) \
172
- : ROBIN_HOOD (BITNESS); \
173
- }(x)
166
+ #define ROBIN_HOOD_COUNT_TRAILING_ZEROES (x ) \
167
+ [](size_t mask) noexcept -> int { \
168
+ unsigned long index ; \ // NOLINT
169
+ return ROBIN_HOOD (BITSCANFORWARD)(&index , mask) \ // NOLINT
170
+ ? static_cast <int >(index ) \ // cppcheck-suppress syntaxError
171
+ : ROBIN_HOOD (BITNESS); \ // cppcheck-suppress syntaxError
172
+ }(x) // cppcheck-suppress syntaxError
174
173
#else
175
174
#if ROBIN_HOOD(BITNESS) == 32
176
175
#define ROBIN_HOOD_PRIVATE_DEFINITION_CTZ () __builtin_ctzl
@@ -429,14 +428,6 @@ class BulkPoolAllocator
429
428
return *this ;
430
429
}
431
430
432
- BulkPoolAllocator &
433
- // NOLINTNEXTLINE (bugprone-unhandled-self-assignment,cert-oop54-cpp)
434
- operator =(const BulkPoolAllocator & ROBIN_HOOD_UNUSED (o) /* unused*/ ) noexcept
435
- {
436
- // does not do anything
437
- return *this ;
438
- }
439
-
440
431
~BulkPoolAllocator () noexcept { reset (); }
441
432
442
433
// Deallocates all allocated memory.
@@ -475,22 +466,6 @@ class BulkPoolAllocator
475
466
mHead = obj;
476
467
}
477
468
478
- // Adds an already allocated block of memory to the allocator. This allocator is from now on
479
- // responsible for freeing the data (with free()). If the provided data is not large enough to
480
- // make use of, it is immediately freed. Otherwise it is reused and freed in the destructor.
481
- void addOrFree (void * ptr, const size_t numBytes) noexcept
482
- {
483
- // calculate number of available elements in ptr
484
- if (numBytes < ALIGNMENT + ALIGNED_SIZE) {
485
- // not enough data for at least one element. Free and return.
486
- ROBIN_HOOD_LOG (" std::free" )
487
- std::free (ptr);
488
- } else {
489
- ROBIN_HOOD_LOG (" add to buffer" )
490
- add (ptr, numBytes);
491
- }
492
- }
493
-
494
469
void swap (BulkPoolAllocator<T, MinNumAllocs, MaxNumAllocs> & other) noexcept
495
470
{
496
471
using std::swap;
@@ -1382,7 +1357,7 @@ class Table
1382
1357
Iter & operator ++() noexcept
1383
1358
{
1384
1359
mInfo ++;
1385
- mKeyVals ++ ;
1360
+ ++ mKeyVals ;
1386
1361
fastForward ();
1387
1362
return *this ;
1388
1363
}
@@ -2035,41 +2010,6 @@ class Table
2035
2010
return emplace (std::move (keyval)).first ;
2036
2011
}
2037
2012
2038
- // Returns 1 if key is found, 0 otherwise.
2039
- size_t count (const key_type & key) const
2040
- { // NOLINT (modernize-use-nodiscard)
2041
- ROBIN_HOOD_TRACE (this )
2042
- auto kv = mKeyVals + findIdx (key);
2043
- if (kv != reinterpret_cast_no_cast_align_warning<Node *>(mInfo )) {
2044
- return 1 ;
2045
- }
2046
- return 0 ;
2047
- }
2048
-
2049
- template <typename OtherKey, typename Self_ = Self>
2050
- // NOLINTNEXTLINE (modernize-use-nodiscard)
2051
- typename std::enable_if<Self_::is_transparent, size_t >::type count (const OtherKey & key) const
2052
- {
2053
- ROBIN_HOOD_TRACE (this )
2054
- auto kv = mKeyVals + findIdx (key);
2055
- if (kv != reinterpret_cast_no_cast_align_warning<Node *>(mInfo )) {
2056
- return 1 ;
2057
- }
2058
- return 0 ;
2059
- }
2060
-
2061
- bool contains (const key_type & key) const
2062
- { // NOLINT (modernize-use-nodiscard)
2063
- return 1U == count (key);
2064
- }
2065
-
2066
- template <typename OtherKey, typename Self_ = Self>
2067
- // NOLINTNEXTLINE (modernize-use-nodiscard)
2068
- typename std::enable_if<Self_::is_transparent, bool >::type contains (const OtherKey & key) const
2069
- {
2070
- return 1U == count (key);
2071
- }
2072
-
2073
2013
// Returns a reference to the value found for key.
2074
2014
// Throws std::out_of_range if element cannot be found
2075
2015
template <typename Q = mapped_type>
0 commit comments