<algorithm>: Should push_heap() tolerate empty ranges?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
https://eel.is/c++draft/push.heap#2 "Requires: The range [first, last - 1) shall be a valid heap with respect to comp and proj."
Our implementation is a no-op for empty ranges:
Is there an algorithm precondition here?
(Standardese citations as of WG21-N4835.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cited [push.heap] wording in WG21-N4835 and the implementation at stl/inc/algorithm lines 2592-2604. Determine whether the empty-range behavior violates an algorithm precondition or should be specified, then identify the implementation or standard-conformance change needed. Done means the precondition question is resolved and the behavior is covered accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100