Checking if a structs .init value is zero bits only

Seb seb at wilzba.ch
Wed Mar 28 01:39:40 UTC 2018


On Wednesday, 28 March 2018 at 00:15:34 UTC, Per Nordlöw wrote:
> Is there a way to check if a struct `S` can be initialized 
> using zero bits only, so that we can allocate and initialize an 
> array of `S` in one go using `calloc`? If not, what should such 
> a trait look like?

Have a look at:

https://github.com/dlang/phobos/pull/6024

(review/feedbackon this PR is welcome!)


More information about the Digitalmars-d-learn mailing list