Skip to content

Commit 9d220b8

Browse files
committed
Restore emplace methods for array_set.
1 parent 83e94d6 commit 9d220b8

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/array_set.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,25 @@ class array_set {
200200

201201

202202

203+
#ifdef TSL_HAS_STRING_VIEW
204+
std::pair<iterator, bool> emplace(const std::basic_string_view<CharT, Traits>& key) {
205+
return m_ht.insert(key.data(), key.size());
206+
}
207+
#else
208+
std::pair<iterator, bool> emplace(const CharT* key) {
209+
return m_ht.insert(key, Traits::length(key));
210+
}
211+
212+
std::pair<iterator, bool> emplace(const std::basic_string<CharT, Traits>& key) {
213+
return m_ht.insert(key.data(), key.size());
214+
}
215+
#endif
216+
std::pair<iterator, bool> emplace_ks(const CharT* key, size_type key_size) {
217+
return m_ht.insert(key, key_size);
218+
}
219+
220+
221+
203222
iterator erase(const_iterator pos) { return m_ht.erase(pos); }
204223
iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); }
205224

0 commit comments

Comments
 (0)