Return by 'ref' problems...

Manu turkeyman at gmail.com
Fri May 4 09:09:40 PDT 2012


On 4 May 2012 18:55, Jakob Ovrum <jakobovrum at gmail.com> wrote:

> On Friday, 4 May 2012 at 15:49:03 UTC, Manu wrote:
>
>> It's very counter intuitive to mark the _function_ ref, rather than it's
>> return type.
>>
>
> It is a function attribute, so it makes perfect sense. The rest is an
> issue of documentation/education.
>
> I agree it may not be optimally intuitive, but I don't see any superior
> syntactic options.
>

Well, I personally see no reason not to allow 'ref' variables anywhere,
just like in C++. Breaking out pointers in D feels a bit dirty, by the same
reasoning that you use C++ references.
Why not make it a type modifier? It would just be a guaranteed initialised
pointer like in C++, and with no pointer assignment semantics.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120504/af8772fa/attachment.html>


More information about the Digitalmars-d mailing list