View source code
Display the source code in dmd/clone.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.clone

Define the implicit opEquals, opAssign, post blit, copy constructor and destructor for structs.

Documentation

https://dlang.org/phobos/dmd_clone.html

Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/clone.d

Functions

NameDescription
buildDtor(ad, sc) Create inclusive destructor for struct/class by aggregating all the destructors in dtors[] with the destructors for all the members.
buildExternDDtor(ad, sc) build a shim function around the compound dtor that translates a C++ destructor to a destructor with extern(D) calling convention
buildInv(ad, sc) Create inclusive invariant for struct/class by aggregating all the invariants in invs[].
buildOpAssign(sd, sc) Build opAssign for a struct.
buildOpEquals(sd, sc) Build opEquals for struct. const bool opEquals(const S s) { ... }
buildXopCmp(sd, sc) Build _xopCmp for TypeInfo_Struct static bool _xopCmp(ref const S p, ref const S q) { return p.opCmp(q); }
buildXopEquals(sd, sc) Build _xopEquals for TypeInfo_Struct static bool _xopEquals(ref const S p, ref const S q) { return p == q; }
buildXtoHash(sd, sc) Build _xtoHash for non-bitwise hashing static hash_t xtoHash(ref const S p) nothrow @trusted;
hasIdentityOpAssign(ad, sc) Check given aggregate actually has an identity opAssign or not.
mergeFuncAttrs(s1, f) Merge function attributes pure, nothrow, @safe, @nogc, and @disable from f into s1.
needOpEquals(sd) We need an opEquals for the struct if any fields has an opEquals. Generate one if a user-specified one does not exist.

Authors

Walter Bright

License

Boost License 1.0