any news on const/invariant?

Walter Bright newshound1 at digitalmars.com
Wed Nov 28 17:40:46 PST 2007


Janice Caron wrote:
> So, how do I declare dg to be a delegate which can call a const member function?
> 
> Would it be
> 
>     (const int delegate()) dg;
> 
> ?

No. Storage class are not type constructors. To use const as a type 
constructor, use ():

	const(int delegate()) dg;



More information about the Digitalmars-d mailing list