Skip to content

<optional>: Should optional::operator* trigger a debug assert if there is no value? #392

@matthew-dews

Description

@matthew-dews

Looking at the implementations of operator* in std::optional I wondered if it would be helpful if they had debug asserts which check that has_value() is true to catch optionals being dereferenced when they shouldn't be. Would this make any sense to add or are there reasons not to have something like that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions