Re: How to cleanup array of structs?

2017-06-04 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 4 June 2017 at 12:24:44 UTC, Suliman wrote: // Will reuse the array, overwriting existing data. // If other parts of the program are using existing data // in the array, this will lead to hard-to-track-down bugs. mytracks.length = 0; mytracks.assumeSafeAppend(); Could you give an

Re: How to cleanup array of structs?

2017-06-04 Thread Suliman via Digitalmars-d-learn
// Will reuse the array, overwriting existing data. // If other parts of the program are using existing data // in the array, this will lead to hard-to-track-down bugs. mytracks.length = 0; mytracks.assumeSafeAppend(); Could you give an example where it can lead bugs? Do you mean multi-thread

Re: How to cleanup array of structs?

2017-06-02 Thread Biotronic via Digitalmars-d-learn
On Friday, 2 June 2017 at 13:32:02 UTC, Suliman wrote: I remember that there was topic about remobing data from struct/arrays of structs. But I do not remember what is idiomatic way to do it, and can't google it. something like: struct MyTrack { ulong id; string

How to cleanup array of structs?

2017-06-02 Thread Suliman via Digitalmars-d-learn
I remember that there was topic about remobing data from struct/arrays of structs. But I do not remember what is idiomatic way to do it, and can't google it. something like: struct MyTrack { ulong id; string recordDate; int velocity; int