Skip to content

[class], [utility], [time] remove redundant constexpr-suitable references to determine constexpr-ness of constructors/destructors #8108

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hanickadot
Copy link
Contributor

It occurred to me constructors/destructors can't be coroutines. Currently only remaining things which makes a function NOT constexpr-suitable is function being a coroutine. Hence constructors and destructors can always be constexpr. Removed wording is redundant and no longer has any meaning.

Question: I can go further and remove constexpr-suitable completely by removing its definition in [dcl.constexpr], and replacing its uses with function is not a coroutine.

…t be coroutines (since P3533R2), therefore they are always constexpr-suitable and removed wording is not needed.
…ors can't be coroutines (since P3533R2), therefore they are always constexpr-suitable and removed wording is not needed. Also removing redundant `constexpr` for constructor of duration which was enforcing `constexpr`-ness which is now default.
…can't be coroutines (since P3533R2), therefore they are always constexpr-suitable and removed wording is not needed.
@Eisenwave
Copy link
Member

The changes seems correct to me, but maybe CWG should have a look at this anyway to be sure.

I would be in favor of deleting "constexpr-suitable" entirely; the term is just adding unnecessary indirection at this point, seeing that it's synonymous with "not a coroutine".

@frederick-vs-ja
Copy link
Contributor

The library parts of the changes overlap with LWG2833. Although I'd be happy to see these parts being fixed editorially.

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 this pull request may close these issues.

3 participants