2 days ago

On Thursday, 27 March 2025 at 06:20:25 UTC, cc wrote:

>

I got in the habit of using static immutable whenever possible as enum just can't be trusted to use CTFE.

enum string RfuncName = fullyQualifiedName!...
// Oops! Allocates on runtime every frame this is referenced
enum string funcName = RfuncName.crc32Of.toHexString();

Woah! I was like "this surely can't be right" but it is... array literal per use because of the implicit string conversion, wow. File a bug for that?

Amusingly, this works correctly: enum string funcName = RfuncName.crc32Of.toHexString().idup;

1 2
Next ›   Last »