On Monday, 16 November 2015 at 07:51:53 UTC, Ali Çehreli wrote:
import std.stdio;
/* This is the storage to the slices that objects will share.
*
* (Surprisingly, creating a slice dynamically is not possible
due
* to syntax issues: new int[N] means "allocates N ints and make
* a slice fro
On 11/14/2015 07:53 AM, Alex wrote:
> 3. The only point I stumble on is, that the main feature in my program
> is, that the underlying array, to which my slices refer to never
> changes. So, I'm going to have more and more slices, which are going to
> be smaller and smaller and each points to the
On Saturday, 14 November 2015 at 11:48:42 UTC, Mike Parker wrote:
So, I create a first var of type S, then the second and copied
the first into the second. The behavior is like intended, the
array inside the struct is copied. But this is a deep copy, as
the third block shows. If I change the a
On Saturday, 14 November 2015 at 10:46:57 UTC, Alex wrote:
Hi everybody,
I have the following question about "by reference" behavior
related to structs.
I have a struct, say S, which contains a member of reference
type
struct S
{
int[] member;
}
and I have a main, for testing:
void mai
Hi everybody,
I have the following question about "by reference" behavior
related to structs.
I have a struct, say S, which contains a member of reference type
struct S
{
int[] member;
}
and I have a main, for testing:
void main()
{
S s; // = new S();
s.arr = [1,2,3];