What is the difference between enum and shared immutable?

IGotD- nise at nise.com
Thu Oct 29 12:42:10 UTC 2020


On Thursday, 29 October 2020 at 12:21:19 UTC, Ola Fosheim Grøstad 
wrote:
>
> You can test this with is(TYPE1==TYPE2)
>
> is(shared(immutable(int))==immutable(int))

So I got that to true, which means that shared immutable is 
exactly the same as immutable. Shared is implicit for immutable 
which makes sense.

That means that the documentation
https://dlang.org/articles/migrate-to-shared.html#immutable

is correct at least this one time.


More information about the Digitalmars-d-learn mailing list