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

[ranges] Consistent style for negated fold expressions in constraints #5481

Open
CaseyCarter opened this issue May 20, 2022 · 1 comment
Open

Comments

@CaseyCarter
Copy link
Contributor

I'm reasonably certain that LWG has forwarded papers for C++23 that use the syntax (for a type pack class... Ts):

  requires (!(meow && ... && Ts))

and other papers that use:

  requires (!meow || ... || !Ts)

These forms are functionally equivalent. I think we should pick one syntax for such negated folds and use it consistently.

@CaseyCarter
Copy link
Contributor Author

Tim Song suggested in LWG:

I personally prefer !(X && ...) though since those are usually paired with another overload that's (Y &&...), and I find it easier to compare the two without De Morgan'ing the former. YMMV

which seems like a good argument to prefer the conjunctive form over the disjunctive.

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

No branches or pull requests

1 participant