www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Assignment Semantics Trait

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()`
Sep 24 2016