what are const scope parameters?

Denton Cockburn diboss at hotmail.com
Fri Mar 7 21:24:23 PST 2008


On Fri, 07 Mar 2008 23:19:02 -0500, Jason House wrote:
> 
> cast at your own risk ;)
> Having c2 still alive in main after the call to bar is ok and expected.  The
> idea is that bar can't keep it but gives no restrictions on the caller. 
> The cast that breaks this stuff is your fault ;)

Ok, without casts.  The point is that the scope specification doesn't
affect the variable at all from what I can see.

I'm thinking the two specifications are the same ("in X p" and "const(X) p")
I need to see an example or an explanation of a situation in which it
doesn't hold.  I wasn't able to find anything in the docs.


More information about the Digitalmars-d-learn mailing list