<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 31 March 2014 17:28, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 3/30/2014 8:32 PM, Adam D. Ruppe wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Monday, 31 March 2014 at 03:25:11 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I also feel quite dirty using pointers in D where there is a dedicated<br>
reference type available. I don't want * and & to appear everywhere in my D code.<br>
</blockquote>
<br>
structs can pretty easily be reference types too:<br>
</blockquote>
<br></div>
Or just:<br>
<br>
alias S* C;<br>
<br>
Voila! Use C as the type instead of S*. The reason this works out so well in D is because C.member works (no need to use -> )<br></blockquote><div><br></div><div>Now it's deceptive that it's a pointer, and the pointer semantics are not suppressed. It might be surprising to find that a type that doesn't look like a pointer behaves like a pointer.</div>
<div>You lose access to the operators, indexing/slicing etc, etc.</div><div>I don't see how this is a reasonable comparison to 'class' as a reference type by definition.</div></div></div></div>