Struct beeing moved around

Sean Kelly sean at invisibleduck.org
Fri May 20 10:43:21 PDT 2011


On May 20, 2011, at 10:28 AM, Michel Fortin wrote:

> On 2011-05-20 10:30:33 -0400, Sean Kelly <sean at invisibleduck.org> said:
> 
>> In main above you're declaring a new struct variable t which is
>> default-constructed, then a temporary is created and initialized to 5,
>> and then the temporary is copied onto t.  It does seem like a postblit
>> should probably occur in this scenario though.
> 
> Postblit is a post-copy constructor, not a post-move one. There is no such thing as a post-move constructor in D: structs are assumed to be movable.

Ah right.  So internal pointers don't work in structs.


More information about the Digitalmars-d mailing list