Skip to content

tl::optional cannot be used with exceptions disabled #56

@FrancisRussell

Description

@FrancisRussell

It's not possible to use tl::optional with exceptions disabled. It would be useful for code that is required to compile without exception support if this were possible. With libstdc++, abort is called instead for conditions that would raise an exception.

It unfortunately varies across compilers how to detect if exception support has been disabled, but in a third party variant implementation this is done by https://github.com/mpark/variant/blob/d1cdfdd3f2ed80710ba4d671fe6bffaa3e28201a/v1.4.0/variant.hpp#L270 with __has_feature defined for non-clang compilers as https://github.com/mpark/variant/blob/d1cdfdd3f2ed80710ba4d671fe6bffaa3e28201a/v1.4.0/variant.hpp#L232.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions