summaryrefslogtreecommitdiffstats
path: root/libcxx/include/set
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Use _EnableIf instead of std::enable_if in deduction guides for map ↵Louis Dionne2019-07-191-12/+12
| | | | | | and set llvm-svn: 366594
* Add contains method to associative containers. This patch implements ↵Zoe Carver2019-07-161-3/+16
| | | | | | P0458R2, adding contains to map, multimap, unordered_map, unordered_multimap, set, multiset, unordered_set, and unordered_multiset. llvm-svn: 366170
* [libc++] Implement deduction guides for <set>Louis Dionne2019-06-111-2/+58
| | | | | | | | | | This is part of C++17's P0433. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58582 llvm-svn: 363090
* [libc++] Make sure we don't eagerly diagnose non-const comparators for ↵Louis Dionne2019-04-111-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | containers of incomplete types Summary: In r348529, I improved the library-defined diagnostic for using containers with a non-const comparator/hasher. However, the check is now performed too early, which leads to the diagnostic being emitted in cases where it shouldn't. See PR41360 for details. This patch moves the diagnostic to the destructor of the containers, which means that the diagnostic will only be emitted when the container is instantiated at a point where the comparator and the key/value are required to be complete. We still retain better diagnostics than before r348529, because the diagnostics are performed in the containers themselves instead of __tree and __hash_table. As a drive-by fix, I improved the diagnostic to mention that we can't find a _viable_ const call operator, as suggested by EricWF in PR41360. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits, zoecarver Tags: #libc Differential Revision: https://reviews.llvm.org/D60540 llvm-svn: 358189
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Implement P1209 - Adopt Consistent Container Erasure from Library ↵Marshall Clow2018-12-141-0/+20
| | | | | | Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532 llvm-svn: 349178
* [libc++] Improve diagnostics for non-const comparators and hashers in ↵Louis Dionne2018-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | associative containers Summary: When providing a non-const-callable comparator in a map or set, the warning diagnostic does not include the point of instantiation of the container that triggered the warning, which makes it difficult to track down the problem. This commit improves the diagnostic by placing it directly in the body of the associative container. The same change is applied to unordered associative containers, which had a similar problem. Finally, this commit cleans up the forward declarations of several map and unordered_map helpers, which are not needed anymore. <rdar://problem/41370747> Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D48955 llvm-svn: 348529
* [libcxx] Fix usage of _C2, which is a "nasty macro" in some environmentsLouis Dionne2018-11-011-20/+20
| | | | | | The problem was pointed out in https://reviews.llvm.org/D48896#inline-475775. llvm-svn: 345834
* Second half of C++17's splicing maps and setsErik Pilkington2018-10-311-0/+95
| | | | | | | | | | This commit adds a merge member function to all the map and set containers, which splices nodes from the source container. This completes support for P0083r3. Differential revision: https://reviews.llvm.org/D48896 llvm-svn: 345744
* Implement the infrastructure for feature-test macros. Very few actual ↵Marshall Clow2018-09-121-0/+1
| | | | | | feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955 llvm-svn: 342073
* First half of C++17's splicing maps and setsErik Pilkington2018-08-011-0/+81
| | | | | | | | | | | | | This commit adds a node handle type, (located in __node_handle), and adds extract() and insert() members to all map and set types, as well as their implementations in __tree and __hash_table. The second half of this feature is adding merge() members, which splice nodes in bulk from one container into another. This will be committed in a follow-up. Differential revision: https://reviews.llvm.org/D46845 llvm-svn: 338472
* Use multi-key tree search for {map, set}::{count, equal_range}Eric Fiselier2018-02-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Mark the transparent version set::count() as const. Thanks to Ivan Matek for ↵Marshall Clow2018-01-071-1/+1
| | | | | | the bug report. llvm-svn: 321966
* First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow2017-11-151-2/+2
| | | | | | '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 llvm-svn: 318269
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multisetEric Fiselier2017-04-181-49/+42
| | | | llvm-svn: 300595
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-041-2/+2
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Fix unused parameters and variablesEric Fiselier2016-12-231-1/+1
| | | | llvm-svn: 290459
* Fix missing const on set::count. Patch from Andrey KhalyavinEric Fiselier2016-12-091-1/+1
| | | | llvm-svn: 289204
* Add static_assert to set/multiset/map/multimap/forward_list/deque that the ↵Marshall Clow2015-11-261-0/+6
| | | | | | allocator's value_type match the container's value_type. vector/unordered/list/string already do this. Add tests for all the containers to verify this. llvm-svn: 254119
* Fix for LWG Issue 2059: C++0x ambiguity problem with map::eraseMarshall Clow2015-05-101-0/+2
| | | | llvm-svn: 236950
* Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for ↵Marshall Clow2014-08-241-0/+12
| | | | | | count(). Thanks to Jim Porter for the bug report llvm-svn: 216353
* Remove some unnecessary noexcept conditions. Thanks to Richard Smith for the ↵Marshall Clow2014-04-161-2/+0
| | | | | | catch. llvm-svn: 206424
* Fix bug I introduced (enabling implicit conversions from compare function to ↵Marshall Clow2014-03-101-2/+20
| | | | | | map) in r202994. Thanks to Sebastian Redl for the catch. llvm-svn: 203443
* Implement LWG 2193. Default constructors for standard library containers are ↵Marshall Clow2014-03-051-4/+4
| | | | | | explicit. Note that libc++ already did this for string/deque/forward_list/list/vector and the unordered containers; implement it for set/multiset/map/multimap. Add tests for all the containers. Two drive-by fixes as well: add a missing explicit in <deque>, and remove a tab that snuck into a container test. This issue is also LLVM bug 15724, and resolves it. llvm-svn: 202994
* LWG Issue #2210 Part 4 - map/multimapMarshall Clow2013-09-111-0/+36
| | | | llvm-svn: 190454
* First half of support for N3657; heterogenous lookups for set/multisetMarshall Clow2013-08-131-0/+128
| | | | llvm-svn: 188241
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-2/+2
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-061-2/+2
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574Howard Hinnant2011-08-121-0/+8
| | | | llvm-svn: 137522
* Correct for new rules regarding implicitly deleted special members. ↵Howard Hinnant2011-07-011-0/+14
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=10191 llvm-svn: 134248
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-24/+24
| | | | llvm-svn: 134190
* noexcept for <set>. Plus a few fixes to noexcept for <map>.Howard Hinnant2011-06-041-80/+139
| | | | llvm-svn: 132640
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* visibility-decoration.Howard Hinnant2010-09-231-16/+120
| | | | llvm-svn: 114658
* Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant2010-09-041-26/+26
| | | | | | flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. llvm-svn: 113086
* Fixing whitespace problemsHoward Hinnant2010-08-221-15/+12
| | | | llvm-svn: 111750
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+841
llvm-svn: 103490
OpenPOWER on IntegriCloud