delegate as memeber

deadalnix deadalnix at gmail.com
Tue Feb 21 07:24:10 PST 2012


struct stuff {
	private Exception delegate() exceptionBuilder = delegate Exception() {
		return new Exception("foobar");
	};
}

The following piece of code trigger a compiler error : delegate 
module.stuff.__dgliteral1 function literals cannot be class members

Why is that ? Is it a bug or a feature ?


More information about the Digitalmars-d-learn mailing list