Boost. 1.91.0 regression: optional<bool> copy constructor broken · Issue #146 · boostorg/optional · GitHub
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
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions