|
|
@@ -88,7 +88,7 @@ public:
|
|
|
return emplace_impl(keys, value);
|
|
|
}
|
|
|
template <typename KS, typename... Args>
|
|
|
- std::pair<iterator, bool> emplace(KS const & keys, Args &&... args) {
|
|
|
+ std::pair<iterator, bool> emplace(KS && keys, Args &&... args) {
|
|
|
return emplace_impl(keys, std::forward<Args>(args)...);
|
|
|
}
|
|
|
template <typename... Args>
|
|
|
@@ -96,6 +96,10 @@ public:
|
|
|
return emplace_impl({key}, std::forward<Args>(args)...);
|
|
|
}
|
|
|
template <typename... Args>
|
|
|
+ std::pair<iterator, bool> emplace(key_type && key, Args &&... args) {
|
|
|
+ return emplace_impl({key}, std::forward<Args>(args)...);
|
|
|
+ }
|
|
|
+ template <typename... Args>
|
|
|
std::pair<iterator, bool> emplace(std::initializer_list<key_type> keys, Args &&... args) {
|
|
|
return emplace_impl(keys, std::forward<Args>(args)...);
|
|
|
}
|
|
|
@@ -143,12 +147,13 @@ private:
|
|
|
return find_impl<std::initializer_list<key_type>>(keys);
|
|
|
}
|
|
|
template <typename KS, typename... Args>
|
|
|
- std::pair<impl_iterator, bool> emplace_impl(KS const & keys, Args &&... args);
|
|
|
+ std::pair<impl_iterator, bool> emplace_impl(KS && keys, Args &&... args);
|
|
|
template <typename... Args>
|
|
|
std::pair<impl_iterator, bool> emplace_impl(std::initializer_list<key_type> key, Args &&... args) {
|
|
|
- return emplace_impl<std::initializer_list<key_type>>(key, std::forward<Args>(args)...);
|
|
|
+ return emplace_impl<std::initializer_list<key_type>>(std::move(key), std::forward<Args>(args)...);
|
|
|
}
|
|
|
- void insert_impl(impl_iterator & out, bool & create, key_type const & key);
|
|
|
+ template <typename Key>
|
|
|
+ void insert_impl(impl_iterator & out, bool & create, Key && key);
|
|
|
|
|
|
friend bool operator==(trie const & lhs, trie const & rhs) {
|
|
|
auto it1 = lhs.begin(), it2 = rhs.begin(), end1 = lhs.end(), end2 = lhs.end();
|