Recommit r260012 - Cleanup node-type handling in the unordered containers.
authorEric Fiselier <eric@efcs.ca>
Wed, 10 Feb 2016 20:46:23 +0000 (20:46 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 10 Feb 2016 20:46:23 +0000 (20:46 +0000)
commit75d0dcfde74dcdb2aacfbfa0a52d8bf72416336b
tree516f774dc7c88233dfdd5456b3db382b8bc2d64d
parentd8a985ec7ce0d6a5d0baa9bfc0ed421e5c3eaf02
Recommit r260012 - Cleanup node-type handling in the unordered containers.

This time I kept <ext/hash_map> working!

This patch is the first in a series of patches that's meant to better
support unordered_map. unordered_map has a special "value_type" that
differs from pair<const Key, Value>. In order to meet the EmplaceConstructible
and CopyInsertable requirements we need to teach __hash_table about this
special value_type.

This patch creates a "__hash_node_types" traits class that contains
all of the typedefs needed by the unordered containers and it's iterators.
These typedefs include ones for each node type and  node pointer type,
as well as special typedefs for "unordered_map"'s value type.

As a result of this change all of the unordered containers now all support
incomplete types.

As a drive-by fix I changed the difference_type in __hash_table to always
be ptrdiff_t. There is a corresponding change to size_type but it cannot
take affect until an ABI break.

This patch will be followed up shortly with fixes for various unordered_map
bugs and problems.

llvm-svn: 260431
libcxx/include/__config
libcxx/include/__hash_table
libcxx/include/ext/hash_map
libcxx/include/unordered_map
libcxx/test/libcxx/containers/unord/key_value_traits.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/unord.map/incomplete_type.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/unord.multimap/incomplete.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/unord.multiset/incomplete.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/unord.set/incomplete.pass.cpp [new file with mode: 0644]