|
|
|
|
|
by dzaima
77 days ago
|
|
> It surprises me that the compiler doesn't still take the inference from the assert and just disable emitting the code to perform the check. That's because that's what the <assert.h> assert() must do; it's specified to do and imply nothing when assertions are disabled. (the standard literally fully defines it as `#define assert(...) ((void)0)` when NDEBUG) Whereas `[[assume(...)]]` is a thing specifically for that "infer things from this without actually emitting any code". |
|