Post APR7j2KNZlczbIU4bg by Ninjatrappeur@social.alternativebit.fr
(DIR) More posts by Ninjatrappeur@social.alternativebit.fr
(DIR) Post #APR7j2KNZlczbIU4bg by Ninjatrappeur@social.alternativebit.fr
2022-11-09T19:09:00.524732Z
1 likes, 1 repeats
This is black magic.https://godbolt.org/z/bonqjsfG7
(DIR) Post #APRAht3IsMtWPFdlg0 by sixohsix@icosahedron.website
2022-11-09T19:25:31Z
1 likes, 0 repeats
@Ninjatrappeur jeeez. The number of constexprs and weird tricks to do this in C++ would be terrifying. Very impressive.
(DIR) Post #APS1hHmcjiYaOBRA8G by romeo@social.romeov.me
2022-11-09T23:51:33Z
1 likes, 1 repeats
@Ninjatrappeur This totally nerd-sniped me and I tried to see if such compile time evaluation is also possible with the recent-ish std::ranges addition to cpp.The compiler can compute on ranges in compile-time, but the array modification is indeed black-rust-only-magic as far as I can tell!https://godbolt.org/z/MbE31sfEd
(DIR) Post #APdkuqZbS7AAFYDQwq by radehi@qoto.org
2022-11-15T04:47:16Z
1 likes, 0 repeats
@Ninjatrappeur that's very impressive, I've never seen a compiler that could do constant folding through mutation like that before