On Tuesday, 8 November 2022 at 12:30:50 UTC, Alexander Zhirov wrote:
Do I understand correctly that in order for me to pass a string when creating an object, I must pass it by value?

You should almost never use `ref string`. Just use plain `string`.

In fact, ref in general in D is a lot more rare than in languages like C++. The main reason to use it for arrays is when you need changes to the length to be visible to the caller... which is fairly rare.

In the case of the variable `c`, a drop occurs. Why? An object is not being created on the stack?

nope, an object isn't created there at all. you should use `new C`.

Reply via email to