Use std::invoke for monadic interface
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
Start by locating the map and flat_map implementations and reviewing the linked P0798 monadic-operations proposal. Determine how std::invoke should support member functions and how overloaded member-function variations affect the interface; done means the supported invocation cases are defined and covered by tests.
Written by the indexing model from the issue text.
Description
At the moment the functions map and flat_map use the function call syntax f(value()). This allows "only" global/static functions and function objects to be used. But it is not possible to use a member function of the wrapped type which would require different call syntax. Using std::invoke(f, value()) instead would lead to a more general interface. This was also proposed in P0798.
One drawback of this approach would be that (e. g. non-const/const) overloaded member functions weren't supported since their type couldn't be deferred (I think?). To support all the variations of no-ref/&/&&, const and noexcept, several new overloads would be needed. And even then, it may not work as expected (?).
- Dominant language
- C++
- Stars
- 60
- Forks
- 75
- 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/optional
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
CMake tests fail Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in boostorg/optional
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 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·