#Building a struct with default value null
1 messages · Page 1 of 1 (latest)
1 messages · Page 1 of 1 (latest)
I am building a struct at compile time with dynamic fields. The fields have a type, which i convert into an optional type (bool -> ?bool). Now i create a list of structfields, where i want to pass null as the actual default value. But passing null to .default_value means, it does not have a default value.
.default_value = &@as(?field.type, null),
I knew something like that existed