uniform initialization in D (as in C++11): i{...}

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 5 07:57:14 PDT 2016


On Tuesday, 5 April 2016 at 14:45:33 UTC, ZombineDev wrote:
> Yeah, that's what I had in mind. new Object{}, int(3) -> 
> int{3}, T() -> T{} (in generic code), and {42, "tuple"} where 
> the type can be deduced.
>
> Unfortunately the (1, 2, 3) syntax is can't be used for tuples 
> because it is ambiguous/looks bad in some



If it is supposed to be uniform, why have the type name in one 
place but not another?

I really don't understand what the problem with Whatever!(x,y,z) 
is.

(other than the fact that Tuple sucks. structs are better in 
every way. but it isn't because of syntax.)


More information about the Digitalmars-d mailing list