On 02/23/2013 08:26 AM, dennis luehring wrote:
func(a,b,c)

can be written as a.func(b,c)

is there a good reason

for not allwing

(a,b).func(c)

or even

(a,b,c).func()?

for me it feels natural

Syntactically, because that is the comma operator.

The following shows an arbitrary limitation:

auto seq(T...)(T args){ return args; }
void func(int a,int b,int c){ }
void main(){ seq(1,2).func(3); }


But the following works:

struct Q(T...){ T q; }
auto q(T...)(T q){ return Q!T(q); }
void func(int a,int b,int c){ }
void main(){ q(1,2).q.func(3); }

Reply via email to