boostorg / boostorg/optional

Why is the ctor of optional<T&> explicit?

Open
#99 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
60
Forks
75
PR merge metrics
No merged PRs in 30d

Description

I mean the ctor `template explicit optional(const optional& rhs)`. It doesn't seem to have much sense - optional is logically a reference and it seems reasonable to allow it to be converted implicitly if the underlying pointer types allow this.
With the current implementation the usage of optional references can be cumbersome, because even the non-const-ref to const-ref conversion has to be explicit.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.