Issues with immutable/inout
Seb
seb at wilzba.ch
Fri May 15 16:51:52 UTC 2020
On Friday, 15 May 2020 at 14:38:54 UTC, Atila Neves wrote:
> On Friday, 15 May 2020 at 11:08:36 UTC, Timon Gehr wrote:
>> On 15.05.20 12:13, burt wrote:
>>> Hello,
>>>
>>> Since D's const, immutable and inout are transitive, it is
>>> more difficult to write const-correct code.
>>
>> There's no such thing. This is a C++-ism.
>
> In D I just take it to mean "usable with const or immutable
> instances". It's a shame (to me at least!) that the default is
> a mutable `this`.
Yes, a preview flag to change the defaults would be very much
appreciated!
Though I guess a pragma or similar to change the shameful
defaults on a per package-basis would even be better ;-)
More information about the Digitalmars-d
mailing list