Asking a const-related fix [Was: Re: DMD workforce contribution]
Timon Gehr
timon.gehr at gmx.ch
Mon Nov 7 08:08:27 PST 2011
On 11/07/2011 11:57 AM, Jonathan M Davis wrote:
>
> That would be altering aa, which isn't legal. const variables can be
> initialized but _can't_ be assigned to. If you want to do something fancier
> than a simple initialization, you're going to need to create another array
> which you do everything to and _then_ initialize the const array with that.
> The errors that you're running into are completely by design.
>
What bearophile is asking for is to treat those cases like an
initialization (what they, in fact, are) rather than like an assignment.
More information about the Digitalmars-d
mailing list