From 6c5b5b31862f3cee71d194f48f088481ea39f508 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Fri, 3 Mar 2023 11:33:32 -0800 Subject: [PATCH] Update comments on type policy to include changes to construct, destroy and move --- include/boost/unordered/detail/foa.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index b7c7d8b3..1c080d08 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1171,11 +1171,20 @@ union uninitialized_storage * a copyable const std::string&&. foa::table::insert is extended to accept * both init_type and value_type references. * - * - TypePolicy::move(element_type&) returns a temporary object for value - * transfer on rehashing, move copy/assignment, and merge. For flat map, this - * object is a std::pair, which is generally cheaper to move - * than std::pair&& because of the constness in Key. For - * node-based tables, this is used to transfer ownership of pointer. + * - TypePolicy::construct and TypePolicy::destroy are used for the + * construction and destruction of the internal types: value_type, init_type + * and element_type. For flat containers, these are often all synonyms for + * each other but for the node-based map, each one is a distinct type. These + * are used for allocator-aware construction and destruction of the types + * during insertion. + * + * - TypePolicy::move is used to provide move semantics for the internal + * types used by the container during rehashing and emplace. These types + * are init_type, value_type and emplace_type. During insertion, a + * stack-local type will be created based on the constructibility of the + * value_type and the supplied arguments. TypePolicy::move is used here + * for transfer of ownership. Similarly, TypePolicy::move is also used + * during rehashing when elements are moved to the new table. * * - TypePolicy::extract returns a const reference to the key part of * a value of type value_type, init_type, element_type or