August 07, 2019 How to mark a condition is likeyly or unlikey ? | ||||
---|---|---|---|---|
| ||||
Hi: In C there has likely unlikely marco used by condition expression。 #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) if (likely(var > 1)) do... How to do this in Dlang? |
August 07, 2019 Re: How to mark a condition is likeyly or unlikey ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to lili | On Wednesday, 7 August 2019 at 11:37:06 UTC, lili wrote: > How to do this in Dlang? Just as in C, this isn't standardized, and I don't think DMD has such a thing. For LDC, see https://forum.dlang.org/thread/ecycecfohgcqkfapiplk@forum.dlang.org. |
Copyright © 1999-2021 by the D Language Foundation