Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 09/11/16 07:02, Stefan Koch wrote: On Wednesday, 9 November 2016 at 05:00:28 UTC, Shachar Shemesh wrote: On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar Please open an issue. Ask and thy shall receive.

Re: Is the following code legal?

2016-11-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 9 November 2016 at 05:00:28 UTC, Shachar Shemesh wrote: On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar Please open an issue.

Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar

Re: Is the following code legal?

2016-11-08 Thread Kagamin via Digitalmars-d
no

Re: Is the following code legal?

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d
On 11/8/16 7:58 AM, Shachar Shemesh wrote: SomeStruct[int] aa; SomeStruct* aap = v in aa; aa.remove(v); writeln(aap); It currently will work. At some point in the past, this did NOT work, as we were proactively freeing the data. I don't know if the policy is that this is officially

Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 08/11/16 14:58, Shachar Shemesh wrote: SomeStruct[int] aa; ... SomeStruct* aap = v in aa; aa.remove(v); writeln(aap); That last line is, of course: "writeln(*aap);" Shachar

Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
SomeStruct[int] aa; ... SomeStruct* aap = v in aa; aa.remove(v); writeln(aap);

Re: Is the following code legal?

2016-11-03 Thread Steven Schveighoffer via Digitalmars-d
On 11/2/16 11:17 AM, Adam D. Ruppe wrote: On Wednesday, 2 November 2016 at 14:21:32 UTC, Shachar Shemesh wrote: The D documentation (https://dlang.org/spec/hash-map.html) leaves this not defined. The foreach statement is defined to not allow it:

Re: Is the following code legal?

2016-11-03 Thread Shachar Shemesh via Digitalmars-d
On 02/11/16 16:52, Andrei Alexandrescu wrote: We should render it defined, and document it as such. Could you please create an issue and I'll have someone look at it. Thanks! -- Andrei https://issues.dlang.org/show_bug.cgi?id=16659

Re: Is the following code legal?

2016-11-02 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 2 November 2016 at 14:21:32 UTC, Shachar Shemesh wrote: The D documentation (https://dlang.org/spec/hash-map.html) leaves this not defined. The foreach statement is defined to not allow it: http://dlang.org/spec/statement.html#ForeachStatement "The aggregate must be loop

Re: Is the following code legal?

2016-11-02 Thread Andrei Alexandrescu via Digitalmars-d
On 11/02/2016 11:17 AM, Adam D. Ruppe wrote: On Wednesday, 2 November 2016 at 14:21:32 UTC, Shachar Shemesh wrote: The D documentation (https://dlang.org/spec/hash-map.html) leaves this not defined. The foreach statement is defined to not allow it:

Re: Is the following code legal?

2016-11-02 Thread Andrei Alexandrescu via Digitalmars-d
On 11/02/2016 10:21 AM, Shachar Shemesh wrote: int[int] hash; .. foreach( key, ref value; hash ) { if( value>12 ) hash.remove(key); } Some hash implementations support this, some don't. The D documentation (https://dlang.org/spec/hash-map.html) leaves this not defined. As

Is the following code legal?

2016-11-02 Thread Shachar Shemesh via Digitalmars-d
int[int] hash; .. foreach( key, ref value; hash ) { if( value>12 ) hash.remove(key); } Some hash implementations support this, some don't. The D documentation (https://dlang.org/spec/hash-map.html) leaves this not defined. As reference, C++ does define this (in C++