Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

implicit constructor not working

Open
#95 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start with the Godbolt reproduction linked in the issue and compare the failing f3 and f4 calls with the working f1 and f2 calls. Read boost/optional.hpp and boost/utility/string_view.hpp to trace the implicit-conversion constructors; done means the f3 and f4 calls compile consistently with the standard optional cases.

Written by the indexing model from the issue text.

Description

calls to f3 and f4 do not compile:
https://godbolt.org/z/K4c1edTK3

#include <optional>
#include <string_view>
#include <boost/optional.hpp>
#include <boost/utility/string_view.hpp>

void f1( std::optional< std::string_view > ) {}
void f2( std::optional< boost::string_view > ) {}
void f3( boost::optional< std::string_view > ) {}
void f4( boost::optional< boost::string_view > ) {}

int main()
{
    f1("hello");
    f2("hello");
    f3("hello");
    f4("hello");
}
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/optional

All issues in boostorg/optional

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.