Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FrancisRussell opened this issue Feb 22, 2022 · 0 comments · May be fixed by #61
Open

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

FrancisRussell opened this issue Feb 22, 2022 · 0 comments · May be fixed by #61

Comments

@FrancisRussell
Copy link

FrancisRussell commented Feb 22, 2022

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.

@FrancisRussell FrancisRussell changed the title Cannot be used with exceptions disabled tl::optional cannot be used with exceptions disabled Feb 22, 2022
@0x804d8000 0x804d8000 linked a pull request Oct 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant