On 4/16/23 00:46, Skippy wrote:

> I wish D had value type classes as well.

That cannot work due to the slicing problem.

C++ cannot have value type classes either for the same reason. The difference there is that the enforcement is by guidelines (e.g. "never pass class objects by value to functions", not by language).

If you want class objects on the stack, you have two options:

- The scope keyword

- The scoped template from Phobos

Ali

Reply via email to