Skip to content

Commit

Permalink
Add hasComplex{Assignment,Copying,Destruction). (#9088)
Browse files Browse the repository at this point in the history
These are the Phobos v3 equivalents of std.traits' hasElaborateAssign,
hasElaborateCopyConstructor, and hasElaborateDestructor. After some
discussion with Adam Wilson, I went with "Complex" rather than
"Elaborate" with the idea that it would be easier to understand for
non-native English speakers. It's also shorter, which is a plus. I also
tried to make the names more consistent (and avoided having
"CopyConstructor" in the name, because it also deals with the postblit
constructor).

For the moment, I have not created hasComplexMoving to check for move
constructors, since that situation has yet to be finalized in the
language. I was surprised to find out that hasElaborateMove was even a
thing, since it was my understanding that opPostMove had never actually
been implemented, so I don't know if we're going to have to worry about
that at all, but either way, it seemed best to leave the question of a
trait for moving until later given that that situation is still in limbo
(even if it does look like the new compiler implementation is well
along).
  • Loading branch information
jmdavis authored Nov 24, 2024
1 parent aee681c commit 0744ca6
Showing 1 changed file with 1,129 additions and 0 deletions.
Loading

0 comments on commit 0744ca6

Please sign in to comment.