llvm / llvm/llvm-project

[libc++] Investigate the precondition fix in P3179R9 for existing algorithms

Open
#166,503 0 comments 0 reactions 0 assignees View on GitHub
hardening libc++
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

[P3179R9](https://wg21.link/p3179r9) (tracked in #148138 and numerous sub-issues) fixed preconditions for the following algorithms, for both `std` and `ranges` versions:
- `copy`
- `copy_if`
- `move`
- `transform`
- `replace_copy`
- `replace_copy_if`
- `remove_copy`
- `remove_copy_if`
- `unique_copy`
- `partition_copy`
- `set_union`
- `set_intersection`
- `set_difference`
- `set_symmetric_difference`

I think the precondition fix should be treated as an LWG DR as it probably superseded [LWG4262](https://cplusplus.github.io/LWG/issue4262) (as noted in https://github.com/microsoft/STL/pull/5683#discussion_r2488923707). Perhaps we should investigate whether our precondition checks (if any) are still correct.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.