avoided segment copying

This commit is contained in:
joaquintides 2018-12-19 18:28:17 +01:00
parent b5fc9c3381
commit 1c3283a561

View File

@ -162,7 +162,7 @@ public:
std::pair<iterator,bool> insert(const key_type& key,P&& x)
{
auto c=map.bucket_count();
auto p=map.insert({&key,std::forward<P>(x)});
auto p=map.emplace(&key,std::forward<P>(x));
if(map.bucket_count()!=c)rebuild_cache();
cache.insert({&key,p.first});
return p;