compare_pointees.hpp should permit a predicate
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reading compare_pointees.hpp and trace how equal_pointees handles null and non-null values. Define the predicate behavior for both optional states and determine how the requested equality and less-than use cases fit the existing interface. Done means the header supports predicate-based pointee comparison without changing nullness handling.
Written by the indexing model from the issue text.
Description
Suppose I have
std::optional<std::pair<int, float>> a, b;
and I want to test equality (or less-than-ness) of the float part, still treating them as optional. That is, thinking of them as optional floats. If equal_pointees had a predicate argument, I could do
equal_pointees(a, b, [](auto& x, auto& y) { return std::get<float>(x) == std::get<float>(y); });
The particular case I'd use this is where I've got a big struct representing the state of a view. For the current frame, I have a pointer to the previous one and a pointer to the current one and I want to decide if I have to a certain part of the work of redrawing. That is, either they have different nullness that's different, or if they are both non-null then compare a projection of them that pertains to the thing I care about.
- Dominant language
- C++
- Stars
- 51
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from boostorg/utility
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in boostorg/utility
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100