So, let's say I have this code

https://run.dlang.io/is/CaMJjd

It doesn't compile, and that makes sense since myNotSharedObject is... not shared. So I can fix it by making the class shared and making a shared instance of it, like this

https://run.dlang.io/is/hoMFD1

And that's how shared is supposed to work, right? Cool, I like it.

But then I try this and... it compiles and runs?

https://run.dlang.io/is/mNQsH1

Or, even worse, even this compiles and runs https://run.dlang.io/is/oyzHcw

So, if I can share non-shared variables/objects/whatever, then what's the point of shared?
  • I can share non shared things... gdelazzari via Digitalmars-d-learn

Reply via email to