From 6f118c1be105e905ee78665f5cf142f9395a82ad Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 26 Nov 2024 00:57:11 +0200 Subject: [PATCH] BAN: Make HashMap key move constructible This allows using non-copyable types as keys --- BAN/include/BAN/HashMap.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BAN/include/BAN/HashMap.h b/BAN/include/BAN/HashMap.h index 9c47d526..108259d6 100644 --- a/BAN/include/BAN/HashMap.h +++ b/BAN/include/BAN/HashMap.h @@ -19,6 +19,12 @@ namespace BAN , value(forward(args)...) {} + template + Entry(Key&& key, Args&&... args) requires is_constructible_v + : key(BAN::move(key)) + , value(forward(args)...) + {} + Key key; T value; };