DIP1000: Walter's proposal to resolve ambiguity of ref-return-scope parameters

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Nov 26 15:43:03 UTC 2021


On Friday, 26 November 2021 at 09:19:45 UTC, Araq wrote:
> & vs ref is just one of the many things that C++ does better 
> than D. And I'm not talking about the syntax: What is a 
> "storage class"? And assuming this terms means anything, why 
> would "ref" be one? In what world is a hidden pointer a 
> "storage class"?

"&" is used for many different things in C++, that is not good. 
Also, having two different reference types is confusing to 
newbies and creates trouble for generic programming.

D should try hard (and harder) to be simpler than C++, yet remain 
familiar to C++ programmers and equally predictable, that is the 
path to adoption.

If D can keep return-scope etc out of application code, then it 
is ok.

(Although D might need annotations that are more specific and 
expressive for libraries, but that is a different topic.)




More information about the Digitalmars-d mailing list