NoInit

When this enum is used as UDA on aggregate types whose instances are created with construct() they won't be initialized, i.e the static layout representing the initial value of the members is not copied.

For example it can be used on a struct that has a @disable this() and when the others constructor are suposed to do the initialization job.

Values

ValueMeaning

Examples

1 @NoInit static struct Foo{int a = 42;}
2 Foo* foo = construct!Foo;
3 // initializer well skipped
4 assert(foo.a != 42);
5 destruct(foo);

Meta