Fix SFINAE on gsl::owner.#1174
Merged
Merged
Conversation
`std::enable_if_t` must not be used as a default template argument, otherwise the instantiator will be able to override it freely with something that doesn't fail substitution. Instead, `std::enable_if_t` itself must be the type of the template argument. More information in the examples here: https://en.cppreference.com/w/cpp/types/enable_if
Member
|
Thanks for the PR! This looks like something we overlooked that has been wrong for a while. Much appreciated :) |
beinhaerter
pushed a commit
to beinhaerter/GSL
that referenced
this pull request
Dec 18, 2024
Replace all occurances of `class = std::enable_if_t<Cond>` and `typename = std::enable_if_t<Cond>` with `std::enable_if_t<Cond, bool> = true`. This commit is inspired by microsoft#1174, which changed one occurance in the owner header. This commit is aimed to fix all remaining occurances.
beinhaerter
pushed a commit
to beinhaerter/GSL
that referenced
this pull request
Dec 18, 2024
Replace the occurances of `class = std::enable_if_t<Cond>` and `typename = std::enable_if_t<Cond>` that have been identified in the previous commit with `std::enable_if_t<Cond, bool> = true`. This commit is inspired by microsoft#1174, which changed one occurance in the owner header. This commit is aimed to fix all remaining occurances.
beinhaerter
pushed a commit
to beinhaerter/GSL
that referenced
this pull request
Dec 19, 2024
Replace the occurances of `class = std::enable_if_t<Cond>` and `typename = std::enable_if_t<Cond>` that have been identified in the previous commit with `std::enable_if_t<Cond, bool> = true`. This commit is inspired by microsoft#1174, which changed one occurance in the owner header. This commit is aimed to fix all remaining occurances.
carsonRadtke
pushed a commit
that referenced
this pull request
Dec 23, 2024
* this commits adds tests that should fail, but don't * Better use of std::enable_if Replace the occurances of `class = std::enable_if_t<Cond>` and `typename = std::enable_if_t<Cond>` that have been identified in the previous commit with `std::enable_if_t<Cond, bool> = true`. This commit is inspired by #1174, which changed one occurance in the owner header. This commit is aimed to fix all remaining occurances. * fix failing checks - core.cxx_gsl aktualisiert auf [](https://gitlab.avm.de/fos/repos/core.cxx_gsl/-/commit/) - plc.access_lib aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.access_lib/-/commit/) - plc.common aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.common/-/commit/) - plc.daemon aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.daemon/-/commit/) - Test Plan: - --------- Co-authored-by: Werner Henze <[email protected]> Co-authored-by: Werner Henze <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
std::enable_if_tmust not be used as a default template argument, otherwise the instantiator will be able to override it freely with something that doesn't fail substitution. Instead,std::enable_if_titself must be the type of the template argument.More information in the examples here: https://en.cppreference.com/w/cpp/types/enable_if