boostorg / boostorg/heap

boost::heap::skew_heap improperly handles rvalue_reference when creating a node.

Open
#24 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
20
Forks
44
PR merge metrics
No merged PRs in 30d

Description

The `skew_heap_node` constructor taking an rvalue reference [makes a copy](https://github.com/boostorg/heap/blob/19fda03545e1b85b3a2d3a94b9a3930ec64335d4/include/boost/heap/skew_heap.hpp#L92-L93) instead of moving it in. This prevents the use of move only types with `skew_heap`.

I'm pretty sure that you just need to add `std::move` to the initializer list construction. E.g.
```
skew_heap_node(value_type && v):
value(std::move(v))
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect boost/heap/skew_heap.hpp at lines 92–93, starting with the skew_heap_node constructor that takes an rvalue reference. Confirm the constructor preserves move-only values rather than copying them; done means skew_heap can be instantiated with move-only types without this construction failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.