is there any reason UFCS can't be used with 'new'?

Jay via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 28 13:50:06 PDT 2014


On Sunday, 28 September 2014 at 20:30:42 UTC, Meta wrote:
> class Button
> {
> 	typeof(this) text(string t)
> 	{
> 		return this;
> 	}
> 	
> 	typeof(this) textColour(int c)
> 	{
> 		return this;
> 	}
> }
>
> void main()
> {
> 	auto b = new Button()
>                     .text("Hello, world!")
>                     .textColour(0xFF000000);
> }

thanks! where should i put it in this table: 
http://wiki.dlang.org/Operator_precedence ?


More information about the Digitalmars-d-learn mailing list