D range, e.g. File.byLine()
will reuse memory buffer (i.e. old buffer contents will be overwritten), if you need save any (sub)string during iteration, you must use byLineCopy()
.
In D, if you (tail-)init a class instance variable when declare it, it is a constant, and shared among all the objects of that class. This behavior is different from C++/Java, although the syntax is the same.
https://forum.dlang.org/post/[email protected]
D has two options for mixins, and both of them require complete statements: Template mixin and string mixin
https://forum.dlang.org/post/[email protected]
https://forum.dlang.org/post/[email protected]
import std.algorithm.mutation.remove; // (*keyword*: mutation)
array = array.remove(index); // return a new container
// v.s.
aa.remove(key); // return bool (if it's removed)