[PATCH] D26885: [libcxx] Fix max_size() across all containers

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 20:57:00 PST 2016


EricWF created this revision.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.

The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values.


https://reviews.llvm.org/D26885

Files:
  include/__hash_table
  include/__tree
  include/deque
  include/forward_list
  include/list
  include/vector
  test/std/containers/associative/map/map.access/max_size.pass.cpp
  test/std/containers/associative/multimap/max_size.pass.cpp
  test/std/containers/associative/multiset/max_size.pass.cpp
  test/std/containers/associative/set/max_size.pass.cpp
  test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
  test/std/containers/sequences/forwardlist/max_size.pass.cpp
  test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
  test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
  test/std/containers/unord/unord.map/max_size.pass.cpp
  test/std/containers/unord/unord.multimap/max_size.pass.cpp
  test/std/containers/unord/unord.multiset/max_size.pass.cpp
  test/std/containers/unord/unord.set/max_size.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26885.78619.patch
Type: text/x-patch
Size: 26366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161119/cb8d6213/attachment-0001.bin>


More information about the cfe-commits mailing list