On Monday, 3 October 2022 at 11:08:00 UTC, Steven Schveighoffer
wrote:
On 10/2/22 12:21 PM, data pulverizer wrote:
I've noticed that `writeln` calls the destructor of a struct
multiple times and would like to know how to stop this from
happening. It has become a very serious problem when
On 10/2/22 12:21 PM, data pulverizer wrote:
I've noticed that `writeln` calls the destructor of a struct multiple
times and would like to know how to stop this from happening. It has
become a very serious problem when working with objects that have memory
management external to D.
I know you
On Sunday, 2 October 2022 at 18:24:51 UTC, Ali Çehreli wrote:
On 10/2/22 10:55, data pulverizer wrote:
> ```
> this(T)(ref return scope T original)
> if(is(T == RVector!(Type)))
> {
> //... code ...
> }
> ```
I've just tested. That is used only for explicit constructor
syntax:
auto
On Sunday, 2 October 2022 at 18:24:51 UTC, Ali Çehreli wrote:
I've just tested. That is used only for explicit constructor
syntax ...
Many thanks. Knowledgeable as always!
On 10/2/22 10:55, data pulverizer wrote:
> On Sunday, 2 October 2022 at 17:28:51 UTC, data pulverizer wrote:
>> Sorry I'll need to implement all the overloaded copy constructors and
>> see if that fixes it.
>
> I've got it, something weird happened to my copy constructor. This was
> my original
On Sunday, 2 October 2022 at 17:51:59 UTC, Ali Çehreli wrote:
What I noticed first in your original code was that it would be
considered buggy because it was not considering copying. Every
struct that does something in its destructor should either have
post-blit (or copy constructor) defined
On Sunday, 2 October 2022 at 17:28:51 UTC, data pulverizer wrote:
Sorry I'll need to implement all the overloaded copy
constructors and see if that fixes it.
I've got it, something weird happened to my copy constructor.
This was my original attempt and was ignored (didn't run in the
copy
On 10/2/22 10:28, data pulverizer wrote:
> On Sunday, 2 October 2022 at 17:19:55 UTC, data pulverizer wrote:
>> Any reason why this could be?
>
What I noticed first in your original code was that it would be
considered buggy because it was not considering copying. Every struct
that does
On Sunday, 2 October 2022 at 17:19:55 UTC, data pulverizer wrote:
Any reason why this could be?
Sorry I'll need to implement all the overloaded copy constructors
and see if that fixes it.
On Sunday, 2 October 2022 at 16:44:25 UTC, Paul Backus wrote:
It's because `writeln` is copying the object, and each of the
copies is being destroyed. If you add a copy constructor to
your example, you can see it happening:
...
I thought something like this could be happening in my original
On Sunday, 2 October 2022 at 16:21:47 UTC, data pulverizer wrote:
I've noticed that `writeln` calls the destructor of a struct
multiple times and would like to know how to stop this from
happening.
It's because `writeln` is copying the object, and each of the
copies is being destroyed. If
I've noticed that `writeln` calls the destructor of a struct
multiple times and would like to know how to stop this from
happening. It has become a very serious problem when working with
objects that have memory management external to D.
Here is a repeatable example, where the destructor
12 matches
Mail list logo