llvm-project/libcxx/test/std/containers/associative/multimap/multimap.ops
Eric Fiselier 9bfdb770cc Use multi-key tree search for {map, set}::{count, equal_range}
Patch from ngolovliov@gmail.com
Reviewed as: https://reviews.llvm.org/D42344

As described in llvm.org/PR30959, the current
implementation of std::{map, key}::{count, equal_range} in libcxx is
non-conforming. Quoting the C++14 standard [associative.reqmts]p3

> The phrase “equivalence of keys” means the equivalence relation imposed by
> the comparison and not the operator== on keys. That is, two keys k1 and k2 are
> considered to be equivalent if for the comparison object comp,
> comp(k1, k2) == false && comp(k2, k1) == false.

In the same section, the requirements table states the following:

> a.equal_range(k) equivalent to make_pair(a.lower_bound(k), a.upper_bound(k))
> a.count(k) returns the number of elements with key equivalent to k

The behaviour of libstdc++ seems to conform to the standard here.

llvm-svn: 324799
2018-02-10 02:53:47 +00:00
..
count.pass.cpp
count0.pass.cpp Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 2017-11-15 07:40:37 +00:00
count1.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
count2.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
count3.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
count_transparent.pass.cpp Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
equal_range.pass.cpp Fix more -Wshadow warnings introduced by recent Clang change 2017-04-04 02:54:27 +00:00
equal_range0.pass.cpp Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 2017-11-15 07:40:37 +00:00
equal_range1.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
equal_range2.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
equal_range3.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
equal_range_transparent.pass.cpp Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
find.pass.cpp Fix more -Wshadow warnings introduced by recent Clang change 2017-04-04 02:54:27 +00:00
find0.pass.cpp Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 2017-11-15 07:40:37 +00:00
find1.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
find2.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
find3.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
lower_bound.pass.cpp Fix more -Wshadow warnings introduced by recent Clang change 2017-04-04 02:54:27 +00:00
lower_bound0.pass.cpp Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 2017-11-15 07:40:37 +00:00
lower_bound1.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
lower_bound2.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
lower_bound3.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
upper_bound.pass.cpp Fix more -Wshadow warnings introduced by recent Clang change 2017-04-04 02:54:27 +00:00
upper_bound0.pass.cpp Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 2017-11-15 07:40:37 +00:00
upper_bound1.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
upper_bound2.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00
upper_bound3.fail.cpp Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065 2017-11-21 21:37:26 +00:00