Skip to content

Boost. 1.91.0 regression: optional<bool> copy constructor broken #146

Description

@MarcelRaad

Consider the following code:

const boost::optional<bool> constValue;
assert(!constValue.has_value()); // succeeds
boost::optional<bool> mutableValue(constValue);
assert(!mutableValue.has_value()); // succeeds
boost::optional<bool> mutableCopy(mutableValue);
assert(!mutableCopy.has_value()); // fails

The reason is that the wrong constructor is taken for boost::optional(boost::optional&):


instead of
constexpr optional(const optional& rhs)
.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions