From 727e36e6a6141237eb2c45f6337c301b83f39f7c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 15 Apr 2017 17:35:09 +0100 Subject: [PATCH] Comment about clear_buckets/create_buckets awkwardness. They both leave the container in an invalid state that needs to be cleaned up immediately. This confused me slightly. --- .../boost/unordered/detail/implementation.hpp | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index e51b0254..2d0830ea 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -2765,8 +2765,30 @@ struct table : boost::unordered::detail::functionsnext_ = node_pointer(); + } + } + + // Create container buckets. If the container already contains any buckets + // the linked list will be transferred to the new buckets, but none + // of the bucket pointers will be set. See above note. + // + // Strong exception safety. void create_buckets(std::size_t new_count) { std::size_t length = new_count + 1; @@ -2931,14 +2953,6 @@ struct table : boost::unordered::detail::functionsnext_ = node_pointer(); - } - } - void destroy_buckets() { bucket_pointer end = get_bucket(bucket_count_ + 1);