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 12:11:22 PDT 2014
i want to chain 'new' with method calls on the created object. i
found this on the internet:
window.mainWidget = (new Button()).text("Hello
world"d).textColor(0xFF0000);
it would look much nicer with UFCS:
window.mainWidget = Button.new().text("Hello
world"d).textColor(0xFF0000);
well, it's not *exactly* UFCS but you get what i mean.
More information about the Digitalmars-d-learn
mailing list