On Friday, 6 May 2022 at 13:35:13 UTC, Steven Schveighoffer wrote:
You don't need to declare an assign operator, the default for
structs is to member-wise copy all the values.
However, if you do provide one, it will be used.
Note that a simple default can be done like:
```d
ref My_File
On 5/5/22 4:27 PM, rempas wrote:
On Thursday, 5 May 2022 at 14:20:49 UTC, Steven Schveighoffer wrote:
Your assignment operator does nothing.
Thanks! That was indeed the problem! In the other data structures, it
worked without needing explicitly provide one so I didn't thought about
it.
On Thursday, 5 May 2022 at 21:07:22 UTC, colleen camacho wrote:
can i use method of Dynamic array in C using malloc library
function. Program example will create an integer array of any
length dynamically by asking the array size and array elements
from user and display on the screen.how
On Thursday, 5 May 2022 at 10:40:44 UTC, rempas wrote:
I have created a structure that is a actually an array that
allocates memory and growths. It is a template and it has
worked with a couple of types that I have tried with. It
doesn't work with one tho and I cannot understand why. I will
On Thursday, 5 May 2022 at 14:20:49 UTC, Steven Schveighoffer
wrote:
Your assignment operator does nothing.
-Steve
Thanks! That was indeed the problem! In the other data
structures, it worked without needing explicitly provide one so I
didn't thought about it. Thanks a lot, you're saving
On Thursday, 5 May 2022 at 11:49:29 UTC, vit wrote:
```d
this.capacity += DEF_VEC_REALLOC_SIZE;
//realloc(this.ptr, T.sizeof * DEF_VEC_REALLOC_SIZE);
this.ptr = realloc(this.ptr, T.sizeof * this.capacity);
//<<--
```
Oh, right! I forgot to say it. I'm using my own
On 5/5/22 6:40 AM, rempas wrote:
ref My_File opAssign(ref const My_File s) return { return this; }
Your assignment operator does nothing.
-Steve
On Thursday, 5 May 2022 at 11:49:29 UTC, vit wrote:
On Thursday, 5 May 2022 at 10:40:44 UTC, rempas wrote:
I have created a structure that is a actually an array that
allocates memory and growths. It is a template and it has
worked with a couple of types that I have tried with. It
doesn't
On Thursday, 5 May 2022 at 10:40:44 UTC, rempas wrote:
I have created a structure that is a actually an array that
allocates memory and growths. It is a template and it has
worked with a couple of types that I have tried with. It
doesn't work with one tho and I cannot understand why. I will
I have created a structure that is a actually an array that
allocates memory and growths. It is a template and it has worked
with a couple of types that I have tried with. It doesn't work
with one tho and I cannot understand why. I will list the
smallest possible code I could. Keep in mind
10 matches
Mail list logo