[Issue 6611] array[]++ and array[]-- too?

2011-09-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6611


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #1 from yebblies yebbl...@gmail.com 2011-09-06 23:34:55 EST ---
This line implies the following
a[]++ = (auto tmp = a[].dup, ++a[], tmp)

Do we really want it to be this easy to do?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6611] array[]++ and array[]-- too?

2011-09-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6611



--- Comment #2 from bearophile_h...@eml.cc 2011-09-06 10:22:34 PDT ---
(In reply to comment #1)
 This line implies the following
 a[]++ = (auto tmp = a[].dup, ++a[], tmp)
 
 Do we really want it to be this easy to do?

I understand. If doing this is not good, then I suggest to turn this into a
diagnostic enhancement request. So given code like this:

void main() {
int[10] a;
a[]++;
}


to raise a single error message that explains why that vector op is on purpose
not supported.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6611] array[]++ and array[]-- too?

2011-09-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6611



--- Comment #3 from yebblies yebbl...@gmail.com 2011-09-07 03:41:35 EST ---
(In reply to comment #2)
 I understand. If doing this is not good, then I suggest to turn this into a
 diagnostic enhancement request. So given code like this:
 

It's probably not worth introducing yet another hidden allocation, or a special
case as it can be easily written using pre-inc.

 void main() {
 int[10] a;
 a[]++;
 }
 
 
 to raise a single error message that explains why that vector op is on purpose
 not supported.

That sounds reasonable, the error message is terrible.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---