dropping parentheses on template instantiation

superdan super at dan.org
Mon Oct 6 12:28:46 PDT 2008


Leandro Lucarella Wrote:

> downs, el  6 de octubre a las 17:28 me escribiste:
> > > auto v = new Vector with Stack with Tuple with (Positive with real,
> > > Matrix with real (3, 3)) ?
> > 
> > auto v = new Vector of Stack of (Positive of real, Matrix of (real, 3, 3));

looks like crap

> > Probably suboptimal. I mostly just threw that out there as a "wouldn't it be cool" to remind people that there are alternatives besides foo[SYMBOL](bar, baz)
> 
> And I don't think:
> auto v = new Vector.(Stack.(Tuple.(Positive.(real), Matrix.(real))))(3, 3))

looks as passable as `!'

> or:
> auto v = new Vector{Stack{Tuple{Positive{real}, Matrix{real}}}}(3, 3))

looks good. i vote for that.

> or:
> auto v = new Vector at Stack@Tuple@(Positive at real, Matrix at real)(3, 3))

is at an advantage. has less parens.




More information about the Digitalmars-d mailing list