-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use C++ style casts #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The casts inside align_up
and align_down
won't work this way, could you change them so the checks pass? I believe special care must be taken when T
is a pointer vs some integer type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM!
https://github.com/alliedmodders/sourcemod/actions/runs/12385271125/job/34571228199 - It seems these changes are not being compiled on clang |
Could it be because of clang 8? It seems like some concepts were introduced with clang 10 & clang 16. |
It seems because of stdc++17 =( |
Makes sense. We develop for C++23 but there is some polyfills for C++20 (not sure how well it works, I never tried it): Line 25 in 60bdee3
|
Everything compiles fine except for this code - https://github.com/cursey/safetyhook/blob/main/include/safetyhook/utility.hpp#L17-L26 |
It seems like concept expressions and auto arguments are both C++20 features. I'm not sure if there's goals to target C++17 or lower (granted, you will have to use polyfill mode anyway for C++20). See: #76 Edit: See reply below. |
I'm fine if you want to throw together a PR that simplifies the offending code to use C++17 features. If it's at least mostly equivalent in functionality I would be fine adopting it. |
Can you give this a try?: #83 |
No description provided.