forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Correct misuses of `__has_cpp_attribute`

Open CaseyCarter opened this issue 1 year ago • 0 comments

Pull Request Prelude

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

CaseyCarter avatar Oct 18 '24 16:10 CaseyCarter