Future of memory management in D

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Nov 18 11:08:17 UTC 2021


On Thursday, 18 November 2021 at 04:24:56 UTC, rumbu wrote:
> * struct inheritance
> * explicit interface implementations
> * class destructuring
> * properties
> * pattern matching on class type
> * pattern matching on fields/properties
> * implicit constructors

What is "class destructuring"?

I would add user-provided default constructors to this list.

> Finally, I found 
> [something](https://digitalmars.com/d/1.0/builtin.html) from 
> the old D1 page:
>
>>Complex Numbers
>>A detailed comparison with C++'s std::complex.
>>
>>The most compelling reason is compatibility with C's imaginary 
>>and complex floating point >types. Next, is the ability to have 
>>imaginary floating point literals. Isn't:
>>
>>c = (6 + 2i - 1 + 3i) / 3i;
>>far preferable than writing:
>>
>>c = (complex!(double)(6,2) + complex!(double)(-1,3)) / 
>>complex!(double)(0,3);
>>? It's no contest.
>
> 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. :-)



More information about the Digitalmars-d mailing list