support references as bounded types?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the issue's Godbolt example and the referenced include/boost/histogram/detail/axes.hpp function to understand the bounded-reference use case. Compare the reported variant2 limitation with std::variant and boost::variant; done means defining and validating support for references as bounded types, including the linked example.
Written by the indexing model from the issue text.
Description
variant2 cannot have references as bounded types, https://godbolt.org/z/mnP-CU, which is conforming with std::variant, but this could be another improvement over std::variant if it is not too much work to implement. boost::variant is supporting them and I am using this in boost.histogram in this function
https://github.com/HDembinski/histogram/blob/5ae08d40c26f8db0613545b84a4c0b60c3729102/include/boost/histogram/detail/axes.hpp#L47
which allows me to get a reference to an element of a std::tuple with a run-time index.
Related SO question:
https://stackoverflow.com/questions/54218595/why-are-references-forbidden-in-stdvariant
- Dominant language
- C++
- Stars
- 71
- Forks
- 41
- 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/variant2
-
Recursive variants Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Member visit(P2637) Open
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 40/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in boostorg/variant2
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 ·