Teach map/unordered_map how to optimize 'emplace(Key, T)'.
authorEric Fiselier <eric@efcs.ca>
Sat, 16 Apr 2016 00:23:12 +0000 (00:23 +0000)
committerEric Fiselier <eric@efcs.ca>
Sat, 16 Apr 2016 00:23:12 +0000 (00:23 +0000)
commit500886841dadba249d8a95f04b2f72eb1c188606
tree718c584bc390a08e88d96439bf267fb4e8e0eefa
parent50154d4ec401043c58e5c74367fc63e6e9c7647d
Teach map/unordered_map how to optimize 'emplace(Key, T)'.

In cases where emplace is called with two arguments and the first one
matches the key_type we can Key to check for duplicates before allocating.

This patch expands on work done by dexonsmith@apple.com.

llvm-svn: 266498
libcxx/include/__hash_table
libcxx/include/__tree
libcxx/include/type_traits
libcxx/test/std/containers/map_allocator_requirement_test_templates.h
libcxx/test/std/containers/set_allocator_requirement_test_templates.h
libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_and_emplace_allocator_requirements.pass.cpp
libcxx/test/support/container_test_types.h