forgottenserver
forgottenserver copied to clipboard
Correct misuses of `__has_cpp_attribute`
Pull Request Prelude
- [X] I have followed proper The Forgotten Server code styling.
- [X] I have read and understood the contribution guidelines before making this PR.
- [X] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
__has_cpp_attribute is for detecting support for attribute-tokens like fallthrough or unlikely. These queries with feature-test macro names are always going to fail since no implementation will ever support an attribute-token with the same name as a feature-test macro. Given the conditional use of library facilities, the intent here is clearly to test the feature-test macros to determine support for those facilities, so let's do that instead.
I've also fixed the using-declaration for std::to_underlying.
Drive-by: Removed extraneous inline in the definition of the constexpr fallback for to_underlying; constexpr functions are implicitly inline.
Issues addressed: None