Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<flat_map>: Fix ordering in insertion and access control in construction #4828

Conversation

frederick-vs-ja
Copy link
Contributor

Addresses the FIXME in #4778. Fixes #4779.

For insertion, WG21-N4981 [associative.reqmts.general]/68 and /72 are fully specifying the order of results. So insert without hint should insert at the upper bound, and three-way comparison result should be used in hinted insertion to determine whether lower_bound or upper_bound should be used.

In construction, the _Other is cast to references to _Flat_map_base to retrieve the correct access control.

Drive-by: remove occurrences of the _NODISCARD_FRIEND workaround, following up #4782.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner July 11, 2024 17:52
@StephanTLavavej StephanTLavavej added bug Something isn't working flat_meow C++23 container adaptors labels Jul 11, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jul 11, 2024
@StephanTLavavej StephanTLavavej merged commit 0d6df8b into microsoft:feature/flat_map Jul 11, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Awesome, thank you! 😻

@frederick-vs-ja frederick-vs-ja deleted the flat_map-insert-access-fix branch July 11, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flat_meow C++23 container adaptors
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants