www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is the following code legal?

reply Shachar Shemesh <shachar weka.io> writes:
SomeStruct[int] aa;

...

SomeStruct* aap = v in aa;
aa.remove(v);
writeln(aap);
Nov 08 2016
next sibling parent Shachar Shemesh <shachar weka.io> writes:
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
Nov 08 2016
prev sibling next sibling parent Steven Schveighoffer <schveiguy yahoo.com> writes:
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 supported or not. Hence, I don't know the answer to the question "is it legal". -Steve
Nov 08 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
no
Nov 08 2016
parent reply Shachar Shemesh <shachar weka.io> writes:
On 08/11/16 17:41, Kagamin wrote:
 no
Is this officially declared in the policy? Should I open an issue? Shachar
Nov 08 2016
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
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.
Nov 08 2016
parent Shachar Shemesh <shachar weka.io> writes:
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. https://issues.dlang.org/show_bug.cgi?id=16674
Nov 08 2016