5 Commits

Author SHA1 Message Date
Hui
831fcb5e91
[libc++] constexpr flat_map (#137453)
Fixes #128673
2025-06-21 13:41:32 +01:00
Alex Guteniev
8631cddd69
libc++ test: update MinSequenceContainer.h to make some tests pass on MSVC STL (#140287)
Per [sequence.reqmts] there are these member functions.

I did not audit if any other member functions are missing. Adding these
is enough for MSVC STL
2025-06-09 18:35:27 +08:00
A. Jiang
2f54a843bb
[libc++][test] Test flat_meow with proper underlying iterators (#131290)
Flat container adaptors require the iterators of underlying containers
to be random access, and it is required that random access container
iterators must support three-way comparison ([container.reqmts]/39 - /41).

As a result, we should at least avoid testing "containers" with random
access but not three-way comparable iterators for flat container
adaptors.

This patch adds a new class template `three_way_random_access_iterator`
to `test_iterators.h` and fixes some usages of `MinSequenceContainer`
with the new iterators.
2025-05-06 16:15:19 -04:00
A. Jiang
51ba9819b4
[libc++][test] Fix size_type issues with MinSequenceContainer and min_allocator (#126267)
`MinSequenceContainer::size` can be narrowing on 64-bit platforms, and
MSVC complains about such implicit conversion. This PR changes the
implicit conversion to explicit `static_cast`.

`min_allocator::allocate` and `min_allocator::deallocate` have
`ptrdiff_t` as the parameter type, which seems weird, because the
underlying `std::allocator`'s member functions take `size_t`. It seems
better to use `size_t` consistently.
2025-02-08 09:26:59 +08:00
Hui
0be1883c36
[libc++] Implement P0429R9 std::flat_map (#98643)
Around half of the tests are based on the tests Arthur O'Dwyer's
original implementation of std::flat_map, with modifications and
removals.

partially implement #105190
2024-10-26 18:58:53 +01:00