Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix SFINAE on gsl::owner.#1174

Merged
carsonRadtke merged 1 commit into
microsoft:mainfrom
lord-pando:patch-1
Dec 13, 2024
Merged

Fix SFINAE on gsl::owner.#1174
carsonRadtke merged 1 commit into
microsoft:mainfrom
lord-pando:patch-1

Conversation

@lord-pando
Copy link
Copy Markdown
Contributor

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

`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
@carsonRadtke carsonRadtke self-assigned this Dec 13, 2024
@carsonRadtke carsonRadtke added Type: Bug Indicates a bug or error Status: Review Needed Needs review from GSL maintainers labels Dec 13, 2024
@carsonRadtke carsonRadtke merged commit aed09c4 into microsoft:main Dec 13, 2024
@carsonRadtke
Copy link
Copy Markdown
Member

Thanks for the PR!

This looks like something we overlooked that has been wrong for a while. Much appreciated :)

@carsonRadtke carsonRadtke added Status: Completed Work is done and can be closed and removed Status: Review Needed Needs review from GSL maintainers labels Dec 13, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Completed Work is done and can be closed Type: Bug Indicates a bug or error

Projects

Development

Successfully merging this pull request may close these issues.

2 participants