Re: Assigning in constructor.

2017-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 19 January 2017 at 00:55:42 UTC, NotSpooky wrote: You already answered on the IRC so thanks X2. So, it's problematic to have pointers to structs in all cases according to spec? Maybe... though in practice (and with C compatibility), pointers to ones where you know the memory

Re: Assigning in constructor.

2017-01-18 Thread NotSpooky via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 23:08:07 UTC, Adam D. Ruppe wrote: On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote: Is it undefined behavior to assign to a pointer in the constructor of a struct? Yes: http://dlang.org/spec/struct.html "A struct is defined to not have an

Re: Assigning in constructor.

2017-01-18 Thread pineapple via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 23:08:07 UTC, Adam D. Ruppe wrote: On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote: Is it undefined behavior to assign to a pointer in the constructor of a struct? Yes: http://dlang.org/spec/struct.html "A struct is defined to not have an

Re: Assigning in constructor.

2017-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote: Is it undefined behavior to assign to a pointer in the constructor of a struct? Yes: http://dlang.org/spec/struct.html "A struct is defined to not have an identity; that is, the implementation is free to make bit copies of the

Assigning in constructor.

2017-01-18 Thread NotSpooky via Digitalmars-d-learn
Is it undefined behavior to assign to a pointer in the constructor of a struct?