digitalmars.D.learn - struct Foo may not define both a rvalue constructor and a copy
- drug (8/8) Oct 16 2019 struct Foo
- rikki cattermole (4/13) Oct 16 2019 Copy constructors were added (sort of like postblit).
- drug (3/20) Oct 16 2019 My question is why the struct may not define both a rvalue ctor and a
struct Foo { this(ref const(Foo) other) {} this(const(Foo) other) {} } I'm trying to update dmd version and starting from 2.086 my code doesn't compile due to the error above. What is the reason of that? Is it temporarily situation?
Oct 16 2019
On 17/10/2019 4:29 AM, drug wrote:struct Foo { this(ref const(Foo) other) {} this(const(Foo) other) {} } I'm trying to update dmd version and starting from 2.086 my code doesn't compile due to the error above. What is the reason of that?Copy constructors were added (sort of like postblit). https://dlang.org/spec/struct.html#struct-copy-constructorIs it temporarily situation?No.
Oct 16 2019
On 10/16/19 6:40 PM, rikki cattermole wrote:On 17/10/2019 4:29 AM, drug wrote:My question is why the struct may not define both a rvalue ctor and a copy ctor?struct Foo { this(ref const(Foo) other) {} this(const(Foo) other) {} } I'm trying to update dmd version and starting from 2.086 my code doesn't compile due to the error above. What is the reason of that?Copy constructors were added (sort of like postblit). https://dlang.org/spec/struct.html#struct-copy-constructorIs it temporarily situation?No.
Oct 16 2019