summaryrefslogtreecommitdiffstats
path: root/external/frozen/cid1532449_use_move_ctor.0
blob: cbee9e510b939b864669d596a3dc4cce11072635 (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
25
26
27
28
29
--- include/frozen/unordered_map.h	2023-06-25 14:47:35.486459668 +0100
+++ include/frozen/unordered_map.h	2023-06-25 14:55:58.787858570 +0100
@@ -78,14 +78,24 @@
 public:
   /* constructors */
   unordered_map(unordered_map const &) = default;
-  constexpr unordered_map(container_type items,
+  constexpr unordered_map(container_type&& items,
+                          Hash const &hash, KeyEqual const &equal)
+      : equal_{equal}
+      , items_(std::move(items))
+      , tables_{
+            bits::make_pmh_tables<storage_size>(
+                items_, hash, bits::GetKey{}, default_prg_t{})} {}
+  explicit constexpr unordered_map(container_type&& items)
+      : unordered_map{items, Hash{}, KeyEqual{}} {}
+
+  constexpr unordered_map(const container_type& items,
                           Hash const &hash, KeyEqual const &equal)
       : equal_{equal}
       , items_{items}
       , tables_{
             bits::make_pmh_tables<storage_size>(
                 items_, hash, bits::GetKey{}, default_prg_t{})} {}
-  explicit constexpr unordered_map(container_type items)
+  explicit constexpr unordered_map(const container_type& items)
       : unordered_map{items, Hash{}, KeyEqual{}} {}
 
   constexpr unordered_map(std::initializer_list<value_type> items,