Fix LWG issue 2469 - Use piecewise construction in map::operator[].
authorEric Fiselier <eric@efcs.ca>
Thu, 31 Mar 2016 03:13:37 +0000 (03:13 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 31 Mar 2016 03:13:37 +0000 (03:13 +0000)
commit54f0cda625d0fee9b357fc98d4036cbf7b98a424
tree081077baffc0d27dd384a869ac27411f3afc26d9
parent851b33a0b1e3c0377f7f8f6262e9ce6a711de235
Fix LWG issue 2469 - Use piecewise construction in map::operator[].

map's allocator may only be used to construct objects of 'value_type',
or in this case 'pair<const Key, Value>'. In order to respect this requirement
in operator[], which requires default constructing the 'mapped_type', we have
to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'.

Unfortunately we still need to provide a fallback implementation for C++03
since we don't have <tuple>. Even worse this fallback is the last remaining
user of '__hash_map_node_destructor' and '__construct_node_with_key'.

This patch also switches try_emplace over to __tree.__emplace_unique_key_args.

llvm-svn: 264989
libcxx/include/map
libcxx/test/std/containers/associative/map/map.access/index_key.pass.cpp
libcxx/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp