llvm-project/libcxx/test/std/containers/associative/multimap
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
..
multimap.cons Add some tests for operations on const associative containers. Part of LWG#2542 2017-11-22 06:02:27 +00:00
multimap.modifiers Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap 2017-04-18 21:08:06 +00:00
multimap.ops Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
multimap.special [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3. 2017-02-05 22:47:09 +00:00
allocator_mismatch.fail.cpp
empty.fail.cpp First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
empty.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
incomplete_type.pass.cpp [libcxx] [test] Fix comment typos, strip trailing whitespace. 2017-01-18 20:10:25 +00:00
iterator.pass.cpp [libcxx] [test] D27021: Fix MSVC warning C4389 "signed/unsigned mismatch", part 8/12. 2016-12-06 01:12:34 +00:00
max_size.pass.cpp [libcxx] Fix max_size() across all containers 2016-11-23 01:18:56 +00:00
scary.pass.cpp
size.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
types.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00