On 2017-02-15 01:08, David Zhang wrote:
Thanks for your answers. Out of curiosity though, how could something
like this be done with classes instead?
You mean if FileDesc was a class? It's basically the same. You would need:
Mutable array:
1. Add a constructor which sets all immutable instanc
Thanks for your answers. Out of curiosity though, how could
something like this be done with classes instead?
On 2017-02-14 01:59, David Zhang wrote:
Hi,
I have a struct with two immutable members, and I want to make an array
of them. How do I to this? I'm using allocators for this.
string[] paths;
struct FileDesc {
immutable string path;
immutable uint index;
}
_fileDesc = /*something*/;
Yo
On 02/13/2017 04:59 PM, David Zhang wrote:
I have a struct with two immutable members, and I want to make an array
of them. How do I to this? I'm using allocators for this.
I realize that I misunderstood you; see below for a mutable array.
The following code produces an immutable array throug
Hi,
I have a struct with two immutable members, and I want to make an
array of them. How do I to this? I'm using allocators for this.
string[] paths;
struct FileDesc {
immutable string path;
immutable uint index;
}
_fileDesc = /*something*/;
You can't use alloc.makeArray because it