| Thread overview | |||||
|---|---|---|---|---|---|
|
February 24, 2015 strings and array literal mutability | ||||
|---|---|---|---|---|
| ||||
Why are strings immutable but array literals are not? | ||||
February 24, 2015 Re: strings and array literal mutability | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Freddy | On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:
> Why are strings immutable but array literals are not?
Because string is an alias for immutable(char).
| |||
February 25, 2015 Re: strings and array literal mutability | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Tobias Pankrath | On 02/24/2015 02:51 PM, Tobias Pankrath wrote:
> On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:
>> Why are strings immutable but array literals are not?
>
> Because string is an alias for immutable(char).
You meant immutable(char)[]. :)
Ali
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply