const(FAQ)

Walter Bright newshound1 at digitalmars.com
Fri Mar 28 22:22:54 PDT 2008


janderson wrote:
> I apologize if this was already suggested but that last section "Why 
> aren't function parameters const by default" got me thinking.  What if 
> you could surround code in a const block:
> 
> const
> {
>    //Anything in here gets const by default
>     void foo(int* p) {}
> };

It already means something else:

	const void foo(int* p) {}



More information about the Digitalmars-d mailing list