Skip to content

Exception thrown in copy constructor when copying empty optional #2

Description

@Andoku

https://github.com/martinmoene/optional-bare/blob/0bb1d183bcee1e854c4ea196b533252c51f98b81/include/nonstd/optional.hpp#L179

May be I don't understand something, but how this line is supposed to work if method value() always checks assert(has_value())?
As i understand it we will always get exception when trying to copy empty optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions