Assignment Semantics Trait

Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 24 10:19:38 PDT 2016


Is there a trait, say `assignmentSemantics`, that tells whether a 
container type `C` has

- copy (C++ containers),
- reference (D containers), or
- move (Rust) semantics

when an instance of `C` is assigned to a new variable. If not, 
could

`__traits(hasMember, C, "dup")`

play a role in such an implementation?

This could, for instance, be used as an
- extra CT-check in C++ to D conversion tools, such as CPP2D and
- aid when implementing `deepDup()`


More information about the Digitalmars-d mailing list