@@ -244,12 +244,12 @@ public:
244
244
destroy_buckets ();
245
245
}
246
246
247
- // Checks whether the bucket container owns any memory , or if has been
248
- // deallocated . If true, the member-wise getter/setter operations will be
249
- // valid, otherwise they cannot be called safely. Object-level members (such
250
- // as hashpower and size) will remain valid after deallocation.
251
- explicit operator bool () const noexcept {
252
- return buckets_ ! = nullptr ;
247
+ // Returns true if the bucket container memory has been deallocated , or false
248
+ // if it still owns any memory . If true, the member-wise getter/setter
249
+ // operations cannot be called safely. Object-level members (such as
250
+ // hashpower and size) will remain valid after deallocation.
251
+ bool is_deallocated () const noexcept {
252
+ return buckets_ = = nullptr ;
253
253
}
254
254
255
255
private:
@@ -292,7 +292,7 @@ private:
292
292
}
293
293
294
294
void destroy_buckets () noexcept {
295
- if (buckets_ == nullptr ) {
295
+ if (is_deallocated () ) {
296
296
return ;
297
297
}
298
298
// The bucket default constructor is nothrow, so we don't have to
@@ -329,7 +329,9 @@ private:
329
329
const bucket_container &>::type src,
330
330
std::integral_constant<bool , B> move) {
331
331
assert (dst_hp >= src.hashpower ());
332
- if (!static_cast <bool >(src)) { return nullptr ; }
332
+ if (src.is_deallocated ()) {
333
+ return nullptr ;
334
+ }
333
335
bucket_container dst (dst_hp, get_allocator ());
334
336
// Move/copy all occupied slots of the source buckets
335
337
for (size_t i = 0 ; i < src.size (); ++i) {
0 commit comments