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

Mark not_null constructors as noexcept when underlying type can be moved with no exception #1135

Merged
merged 1 commit into from Oct 18, 2023

Conversation

mymedia2
Copy link
Contributor

@mymedia2 mymedia2 commented Sep 3, 2023

This enables possible optimisations for trivial types. This also avoids a bug in std::variant::emplace from GNU's libstdc++.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106547

Closes: #1134

…ved with no exception

This enables possible optimisations for trivial types. This also avoids a bug
in std::variant::emplace from GNU's libstdc++.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106547
@dmitrykobets-msft
Copy link
Member

Hi @mymedia2, with a quick inspection this looks reasonable, but I'll defer this for the next maintainers' sync. Thanks for the PR.

@hsutter hsutter merged commit e64c97f into microsoft:main Oct 18, 2023
62 checks passed
@hsutter
Copy link
Collaborator

hsutter commented Oct 18, 2023

Thanks!

@d-winsor d-winsor assigned d-winsor and unassigned d-winsor Oct 18, 2023
@beinhaerter
Copy link
Contributor

The changes only apply to not_null, they are not applied to strict_not_null. Is there any reason for that? Or was this only overseen/forgotten?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gsl::not_null and std::variant are not fully compatible
5 participants