summaryrefslogtreecommitdiffstats
path: root/external/frozen/cid1586676_use_move_ctor.0
blob: 944d1747098c78e7fe7d278d76adb6d063b0e602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- include/frozen/unordered_set.h	2024-01-22 10:42:57.125966099 +0000
+++ include/frozen/unordered_set.h	2024-01-22 10:46:07.701159961 +0000
@@ -74,13 +74,19 @@
 public:
   /* constructors */
   unordered_set(unordered_set const &) = default;
-  constexpr unordered_set(container_type keys, Hash const &hash,
+  constexpr unordered_set(container_type&& keys, Hash const &hash,
+                          KeyEqual const &equal)
+      : equal_{equal}
+      , keys_{std::move(keys)}
+      , tables_{bits::make_pmh_tables<storage_size>(
+            keys_, hash, bits::Get{}, default_prg_t{})} {}
+  constexpr unordered_set(const container_type& keys, Hash const &hash,
                           KeyEqual const &equal)
       : equal_{equal}
       , keys_{keys}
       , tables_{bits::make_pmh_tables<storage_size>(
             keys_, hash, bits::Get{}, default_prg_t{})} {}
-  explicit constexpr unordered_set(container_type keys)
+  explicit constexpr unordered_set(const container_type& keys)
       : unordered_set{keys, Hash{}, KeyEqual{}} {}
 
   constexpr unordered_set(std::initializer_list<Key> keys)