diff options
Diffstat (limited to 'abseil-cpp/absl/container/internal/common.h')
-rw-r--r-- | abseil-cpp/absl/container/internal/common.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/abseil-cpp/absl/container/internal/common.h b/abseil-cpp/absl/container/internal/common.h index 030e9d4..9239bb4 100644 --- a/abseil-cpp/absl/container/internal/common.h +++ b/abseil-cpp/absl/container/internal/common.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_CONTAINER_INTERNAL_CONTAINER_H_ -#define ABSL_CONTAINER_INTERNAL_CONTAINER_H_ +#ifndef ABSL_CONTAINER_INTERNAL_COMMON_H_ +#define ABSL_CONTAINER_INTERNAL_COMMON_H_ #include <cassert> #include <type_traits> @@ -84,10 +84,11 @@ class node_handle_base { PolicyTraits::transfer(alloc(), slot(), s); } - struct move_tag_t {}; - node_handle_base(move_tag_t, const allocator_type& a, slot_type* s) + struct construct_tag_t {}; + template <typename... Args> + node_handle_base(construct_tag_t, const allocator_type& a, Args&&... args) : alloc_(a) { - PolicyTraits::construct(alloc(), slot(), s); + PolicyTraits::construct(alloc(), slot(), std::forward<Args>(args)...); } void destroy() { @@ -186,8 +187,8 @@ struct CommonAccess { } template <typename T, typename... Args> - static T Move(Args&&... args) { - return T(typename T::move_tag_t{}, std::forward<Args>(args)...); + static T Construct(Args&&... args) { + return T(typename T::construct_tag_t{}, std::forward<Args>(args)...); } }; @@ -203,4 +204,4 @@ struct InsertReturnType { ABSL_NAMESPACE_END } // namespace absl -#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_H_ +#endif // ABSL_CONTAINER_INTERNAL_COMMON_H_ |