17 Commits

Author SHA1 Message Date
halbi2
be0889030e
[libc++][NFC] Remove unused __key_equiv from flat_multimap and flat_multiset (#175612) 2026-01-13 10:37:24 +01:00
Hewill Kang
19358ca38c
[libc++] Make sure flat_set::key_compare handle boolean-testable correctly (#132622)
Also add test for `flat_multiset` to avoid regression.

---------

Co-authored-by: Hui Xie <hui.xie1990@gmail.com>
Co-authored-by: A. Jiang <de34@live.cn>
2026-01-03 14:50:45 +00:00
Hui
cd13170aea
[libc++] Implement P3567R2 flat_meow fixes (#162022)
Fixes #171272

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-12-20 21:18:44 +00:00
Hristo Hristov
86dc131997
[libc++][flat_multiset] Applied [[nodiscard]] (#169984)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.

-  https://libcxx.llvm.org/CodingGuidelines.htm
-  https://wg21.link/flat.multiset
2025-12-14 16:49:55 +08:00
Hristo Hristov
df8061272a
[libc++][flat_set] Applied [[nodiscard]] (#169739)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.

-
https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
2025-11-27 20:29:39 +08:00
Hui
c07440b887
[libc++] constexpr flat_multiset (#161016)
Fixes https://github.com/llvm/llvm-project/issues/128676
2025-11-01 08:51:35 +00:00
Nikolas Klauser
4732ab5083
[libc++] Enable Clang modules in most of the CI runs (#160251)
Enabling modules makes the CI quite a bit faster with basically no
downsides. The non-modules build is still tested through the
`generic-cxxab` configurations, but most of the other CI runs on
platforms with modules support now use modules.
2025-10-26 17:07:28 +01:00
Nikolas Klauser
70b7874ab2
[libc++] Make the naming of the iterator_traits aliases consistent (#161661)
This renames all the `iterator_traits` alises to be
`__iterator_<type-name>`. e.g `iterator_traits<T>::value_type` will be
`__iterator_value_type<T>`.
2025-10-07 14:42:11 +02:00
Nikolas Klauser
1ab4113d0e
[libc++] Remove a bunch of unused includes from <flat_*> (#160658) 2025-09-28 09:19:15 +02:00
Nikolas Klauser
8cb03a05ff
[libc++][NFC] Refactor __is_allocator to be a variable template (#159584) 2025-09-24 10:41:29 +02:00
Hui
9eb4fc7006
[libc++] constexpr flat_set (#140360)
Fixes #128675
2025-07-05 17:38:45 +01:00
Hui
692c5cdb56
[libc++] Do not call reserve in flat containers if underlying container is user defined (#140379)
This is brought up in the LWG reflector. We currently call `reserve` if
the underlying container has one. But the spec does not specify what
`reserve` should do for Sequence Container. So in theory if the
underlying container is user defined type and it can have a function
called `reserve` which does something completely different.

The fix is to just call `reserve` for STL containers if it has one
2025-06-07 08:47:46 +01:00
Hui
155fd97a66
[libc++] flat_meow transparent comparator string literals (#133654)
See discussion in https://cplusplus.github.io/LWG/issue4239

    std::flat_map<std::string, int, std::less<>> m;
    m.try_emplace("abc", 5);  // hard error

The reason is that we specify in 23.6.8.7 [flat.map.modifiers]/p21
the effect to be as if `ranges::upper_bound` is called.

`ranges::upper_bound` requires indirect_strict_weak_order, which
requires the comparator to be invocable for all combinations. In this
case, it requires

    const char (&)[4] < const char (&)[4]

to be well-formed, which is no longer the case in C++26 after
https://wg21.link/P2865R6.

This patch uses `std::upper_bound` instead.
2025-06-06 13:05:36 -04:00
Hui
4b104c6853
[libc++] Fix flat_{multi}set insert_range (#137462)
Fixes #136656
2025-05-16 13:17:21 -04:00
Hui
7013b51548
[libc++] Implement std::flat_multiset (#128363)
fixes https://github.com/llvm/llvm-project/issues/105193
2025-04-06 10:50:55 +01:00
Hui
e16541e1a6
[libc++] fix flat_set's transparent insert (#133402)
Unlike `flat_map` and `flat_multimap`, The two function template
overloads `flat_set::insert`'s wording strongly suggest we should use
the transparent comparator
https://eel.is/c++draft/flat.set#modifiers-1

Both the code and the tests were not using the transparent comparator,
which needs to be fixed
2025-03-29 16:29:31 +00:00
Hui
2f1416bbcd
[libc++] implement std::flat_set (#125241)
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-03-23 14:45:21 +00:00