Blog post: What D got wrong

Atila Neves atila.neves at gmail.com
Thu Dec 20 14:52:29 UTC 2018


On Wednesday, 19 December 2018 at 23:10:34 UTC, Rubn wrote:
> On Wednesday, 19 December 2018 at 19:58:53 UTC, Neia Neutuladh 
> wrote:
>> [...]
>
> To be fair even in c++ this won't be a reference.
>
> int& foo();
> auto a = foo(); // a == int
> auto& a = foo(); // a == int&
>
> So it shouldn't be that surprising.

decltype(auto) a = foo(); // a == int&

And you can explicitly declare `auto&` in C++, which you can't do 
in D.



More information about the Digitalmars-d-announce mailing list