llvm-project/libcxx/test
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
..
libcxx Improve a test. NFC 2018-02-08 05:47:40 +00:00
std Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
support libcxx: Provide overloads for basic_filebuf::open() et al that take wchar_t* filenames on Windows. 2018-01-23 02:07:27 +00:00
CMakeLists.txt [libcxx] Support the use of compiler-rt in lit tests 2018-01-08 23:36:53 +00:00
lit.cfg Move libcxx/test/libcxx python package into libcxx/utils/libcxx. 2017-02-09 23:18:11 +00:00
lit.site.cfg.in [libcxx] Support the use of compiler-rt in lit tests 2018-01-08 23:36:53 +00:00
nothing_to_do.pass.cpp Test commit: Reverting whitespace changes 2014-07-17 05:10:03 +00:00