Basile B. wrote:

On Friday, 9 June 2017 at 17:18:43 UTC, ketmar wrote:
Basile B. wrote:

     enum binFloat = *cast(float*) &b;

i was SO sure that this won't work in CTFE that i didn't even tried to do it. "it will fail anyway, there is no reason in trying!" ;-)

You can do the arithmetic as well. I don't know why but i supposed that my static asserts were a proof of CTFE-ability.

yeah, it is CTFEable. now i recall that such casting for floats was special-cased in interpreter exactly to allow this kind of things. my bad.

Reply via email to