| ... | ... | @@ -5015,12 +5015,12 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val |
| 5015 | 5015 | in an API runs the risk of introducing dead code into the codebase, |
| 5016 | 5016 | unnoticed. For example, if the field is ever renamed, code which uses |
| 5017 | 5017 | {#syntax#}@hasDecl{#endsyntax#} will compile successfully while failing |
| 5018 | | to enable or disable an intended block of code. Even a simple a typo in |
| 5018 | to enable or disable an intended block of code. Even a simple typo in |
| 5019 | 5019 | the field name passed to {#syntax#}@hasDecl{#endsyntax#} would go |
| 5020 | 5020 | unnoticed by the compiler. Thus, it is safer to use alternative methods |
| 5021 | 5021 | to check for the presence or absence of a particular declaration where |
| 5022 | 5022 | possible. For example, if the target operating system would indicate whether a particular |
| 5023 | | function is available, it more maintainable to check |
| 5023 | function is available, it is more maintainable to check |
| 5024 | 5024 | {#syntax#}@import("builtin").target.os.tag{#endsyntax#} rather than |
| 5025 | 5025 | {#syntax#}@hasDecl{#endsyntax#}.</p> |
| 5026 | 5026 | |