Re: Different types with auto

2011-03-19 Thread Bekenn
On 3/18/2011 12:59 PM, bearophile wrote: http://d.puremagic.com/issues/show_bug.cgi?id=2656 Thank goodness that's under discussion.

Re: Different types with auto

2011-03-18 Thread bearophile
Jacob Carlborg: > Yes, it must die. It also conflicts with uniform function call syntax. Currently this is mixed with the octal literals discussion: http://d.puremagic.com/issues/show_bug.cgi?id=2656 http://d.puremagic.com/issues/show_bug.cgi?id=3837 But I think it's better to move it to a speci

Re: Different types with auto

2011-03-18 Thread Jacob Carlborg
On 2011-03-17 21:35, Nick Sabalausky wrote: "bearophile" wrote in message news:iltdqr$1rd7$1...@digitalmars.com... D disallows bug-prone C syntax like this (C style guides strongly suggest to declare only each variable in a distinct statement and line of code): int a = 1, *b = null; D accept

Re: Different types with auto

2011-03-18 Thread Regan Heath
On Fri, 18 Mar 2011 00:30:30 -, Andrei Alexandrescu wrote: On 3/17/11 7:27 PM, KennyTM~ wrote: On Mar 18, 11 04:17, Jason E. Aten wrote: auto x1=1., x2=2., x3=3., x4=4., x5=5, x6=6.; If the coder wanted them to all be doubles, it's easy to require that by just saying so, and then e

Re: Different types with auto

2011-03-17 Thread Andrei Alexandrescu
On 3/17/11 7:27 PM, KennyTM~ wrote: On Mar 18, 11 04:17, Jason E. Aten wrote: auto x1=1., x2=2., x3=3., x4=4., x5=5, x6=6.; If the coder wanted them to all be doubles, it's easy to require that by just saying so, and then even x5 will be a double. double x1=1., x2=2, ... So it seems to me th

Re: Different types with auto

2011-03-17 Thread KennyTM~
On Mar 18, 11 04:17, Jason E. Aten wrote: auto x1=1., x2=2., x3=3., x4=4., x5=5, x6=6.; If the coder wanted them to all be doubles, it's easy to require that by just saying so, and then even x5 will be a double. double x1=1., x2=2, ... So it seems to me that auto does exactly what you asked i

Re: Different types with auto

2011-03-17 Thread Jonathan M Davis
On Thursday, March 17, 2011 13:17:33 Jason E. Aten wrote: > > auto x1=1., x2=2., x3=3., x4=4., x5=5, x6=6.; > > If the coder wanted them to all be doubles, it's easy to require that by > just saying so, and then even x5 will be a double. > > double x1=1., x2=2, ... > > So it seems to me that aut

Re: Different types with auto

2011-03-17 Thread Nick Sabalausky
"bearophile" wrote in message news:iltdqr$1rd7$1...@digitalmars.com... > > D disallows bug-prone C syntax like this (C style guides strongly suggest > to declare only each variable in a distinct statement and line of code): > > int a = 1, *b = null; > > D accepts code like: > >> auto a = 1, b =

Re: Different types with auto

2011-03-17 Thread Jason E. Aten
> auto x1=1., x2=2., x3=3., x4=4., x5=5, x6=6.; If the coder wanted them to all be doubles, it's easy to require that by just saying so, and then even x5 will be a double. double x1=1., x2=2, ... So it seems to me that auto does exactly what you asked it to here, and I actually prefer this beh

Different types with auto

2011-03-17 Thread bearophile
I have found this article through Reddit (the Reddit page already contains comments by Andrei), "C++0x feature support in GCC 4.5" by Arpan Sen: http://www.ibm.com/developerworks/aix/library/au-gcc/index.html The article probably doesn't contain new things for people that have closely followed t