unqualified call to `get<T>` with a non-`boost::optional` type should not match
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
Start with the minimal C++ reproducer in the issue and inspect the overloads brought in by boost/optional.hpp, comparing qualified and unqualified get calls. Reproduce the failure using the linked Compiler Explorer example; done means the shown unqualified call compiles without trying to instantiate boost::optional.
Written by the indexing model from the issue text.
Description
boost::get<T>(boost::optional<T> ...) overload matches for a non-boost::optional type when boost namespace is associated with argument's type of unqualified call to get<T>.
template <typename U>
struct X {};
template <typename T, typename U>
inline int get(X<U> const&) { return 0; }
namespace boost {
struct any_type_in_boost_namespace {};
}
#include <boost/optional.hpp>
class tag;
int main()
{
get<tag>(X<boost::any_type_in_boost_namespace>{});
}
The example obviously should compile, but instead it tries to instantiate boost::optional<tag> and fails the compilation.
- 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
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
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