To what extent a source should overwrite a target when melding.
UDA conveying that this member's value cannot or should not be melded.
Takes two structs or classes of the same type and melds them together, making the members a union of the two.
Takes two arrays and melds them together, making a union of the two.
Takes two associative arrays and melds them together, making a union of the two.
struct Foo { string abc; string def; int i; float f; double d; } Foo f1; // = new Foo; f1.abc = "ABC"; f1.def = "DEF"; Foo f2; // = new Foo; f2.abc = "this won't get copied"; f2.def = "neither will this"; f2.i = 42; f2.f = 3.14f; f2.meldInto(f1); with (f1) { import std.math : isNaN; assert(abc == "ABC"); assert(def == "DEF"); assert(i == 42); assert(f == 3.14f); assert(d.isNaN); }
This module contains the meldInto functions; functions that take two structs or classes of the same type and combine them, creating a resulting object with the union of the members of both parents. Array and associative array variants exist too.