boostorg / boostorg/hana

overload's constructor isn't constrained

Open
#412 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Short example:

```
#include "boost/hana.hpp"

void f();
void g(int);

int main() {
auto a = boost::hana::overload(f,g);
auto b(a); // error
}
```

This is because `overload_t`'s constructor doesn't have any constraints on its first parameter (need to do the `!is_same_v, overload_t>` dance).

Contributor guide

Open the contributing guide

Research direction

Locate the definition of overload_t and its constructor, then inspect the existing tests for overload behavior. Reproduce the copy-initialization example and verify that constructing an overload_t from another overload_t no longer selects the unconstrained constructor, with the relevant regression test passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.