http://d.puremagic.com/issues/show_bug.cgi?id=9112
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #9 from [email protected] 2012-12-06 22:30:28 PST --- (In reply to comment #1) > This is useful in generic code: > int n = int(10); EXTREMELY useful. Just the other day, I was writing a unittest to cover appender with as many types as possible, and wanted to write something along the lines of: //---- foreach (SS; TypeTuple!(int, S0, S1, S2, S3, S4, S5, S6, S7)) { foreach (S; TypeTuple!(SS, const(SS), immutable(SS))) { auto app1 = appender!(S[])(); foreach(i; 0 .. 0x20000) app1.put(S(i)); // HERE //---- Long story short: "int" didn't make it into the final test... (In reply to comment #2) > What I really want to be able to do is stuff like > > auto i = new int(5); > auto j = new immutable(int)(7); > > Right now, you have to do nonsense like > > auto i = new int; > *i = 5; You always have the auto j = [cast(immutable int)5].ptr; "Trick". But that's still ugly as sin, and I'm not sure what you are actually paying for when doing this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
