Make all functions from std.typecons "Proxy" inout

Steven Schveighoffer schveiguy at yahoo.com
Fri May 11 05:30:29 PDT 2012


On Fri, 11 May 2012 08:05:33 -0400, sclytrack <sclytrack at iq87.fr> wrote:

>
>> import std.stdio;
>>
>> void test1(shared const float [] p)
>> {
>> writeln("works");
>> }
>>
>
> Nope, "shared const" still doesn't make sense to me.
> In the above example the p values can still change
> at any time.
>
> Why does "shared const" even exist?

shared means it can be possibly accessed by other threads
const means you can't change it through this reference *but* another  
reference could change the values it points at.

Combine both, and you will realize that it could possibly be changing *as  
you use it*.

Why do you think we don't need it?

-Steve


More information about the Digitalmars-d-learn mailing list