Re: Changing the class data underneath some reference

2017-11-29 Thread David Colson via Digitalmars-d-learn
On Thursday, 30 November 2017 at 00:40:51 UTC, David Colson wrote: Hello all! I'm getting settled into D and I came into a problem. A code sample shows it best: class SomeType { string text; this(string input) {text = input;} } void main() { SomeType foo = new SomeType("Hello");

Changing the class data underneath some reference

2017-11-29 Thread David Colson via Digitalmars-d-learn
Hello all! I'm getting settled into D and I came into a problem. A code sample shows it best: class SomeType { string text; this(string input) {text = input;} } void main() { SomeType foo = new SomeType("Hello"); SomeType bar = foo; foo = new SomeType("World"); wri