2015-02-10 0:15 GMT+09:00 via Digitalmars-d <[email protected]>:
> On Monday, 9 February 2015 at 13:19:24 UTC, Tobias Pankrath wrote: > >> On Monday, 9 February 2015 at 12:39:06 UTC, Marc Schütz wrote: >> >>> It does? Not according to my tests. And it would be bad if it did, >>> because the returned immutable value could actually reside in read-only >>> memory. >>> >> >> join returns a mutable array, that can be implicitly casted to immutable >> if join is pure. >> > > I'm talking about the general case. Jacob seems to be saying that a unique > _immutable_ value is implicitly convertible to mutable. > In general, pure function can access immutable global data, and can return its address. Therefore, if a pure function returns immutable data, the returned pointer/reference to immutable a data should not be convertible to mutable. Kenji Hara
