[ranges.syn] Don't constrain specializations of enable_borrowed_range #4519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These constraints redundantly repeat the constraints from the template we're partially specializing for. This isn't incorrect, but it is unnecessary, adds opportunities for editorial errors, and is inconsistent with how other partial specializations of templates for constrained types are specified.
EDIT: To be perfectly clear, removing these constraints has no normative effect. One cannot so much as form the template-id
meow<T, U>
ifT
andU
don't satisfy the constraints ofmeow
. So if a partial specialization matches the patternmeow<T, U>
, we know a priori that the constraints ofmeow
are satisfied byT
andU
. The only possible results of duplicating the constraints are that an implementation may waste compiletime rechecking them, and WG21 will waste time keeping them in sync. Witness the recent fiasco that resulted from changing the constraints oniota_view
and failing to propagate that change to the four necessary places (microsoft/STL#1693 (comment)) for reference; we have enough required duplication without adding optional duplication =).