Allow rvalue_refs to be used with push and update methods (update, increase, and decrease)
- Dominant language
- C++
- Stars
- 20
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Currently, only `emplace` has move semantics with regards to adding or updating the values in any of the heaps. This is limiting when the `value_type` is move only, especially as there is no workaround for the update methods. (`emplace` will invoke the move constructor, so it can be used as work around for `push`.) I propose adding overloads for the adding or updating methods to allow for values with move semantics to be used, e.g.
`handle_type push(value_type&&);`
`void update(handle_type, value_type&&);`
`void increase(handle_type, value_type&&);`
`void decrease(handle_type, value_type&&);`
`void update_lazy(handle_type, value_type&&); // fibonacci_heap only`
A similar issue exists in #23 for dealing with the comparison function.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the existing emplace, push, update, increase, and decrease entry points across the heaps, including update_lazy for fibonacci_heap. Compare their current value_type handling and identify the related tests, then verify that each proposed rvalue-reference overload works with move-only values without changing existing lvalue behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100