Future of memory management in D

Rumbu rumbu at rumbu.ro
Thu Nov 18 12:42:04 UTC 2021


On Thursday, 18 November 2021 at 11:08:17 UTC, Ola Fosheim 
Grøstad wrote:

> What is "class destructuring"?

In D idioms allowing to overload tupleof if it was an operator. 
Combined with tuple support you can have the following code:

```
class A { int x; int y}
A a = new A();
(int v, int w) = a; // v will contain a.x, w will contain a.y

```

>>
>> 15 years ago. I will reply  with this quote to everyone who 
>> has "another library solution".
>
> C++ can do this in a library:
>
> https://en.cppreference.com/w/cpp/language/user_literal
>
> You need to find a better example. :-)

This was to show how D paradigm shifted in 15 years from avoiding 
library solutions to encouraging them.



More information about the Digitalmars-d mailing list