Will D ever get a reference type?
Bill Baxter
dnewsgroup at billbaxter.com
Sat Jul 28 12:27:59 PDT 2007
BCS wrote:
> Reply to Bill,
>
>> Will D ever get a reference type?
>>
>> I don't think pointers are really sufficient.
>> The handy 'foo.bar' == '(*foo).bar' attribute access is nice, but it
>> doesn't allow you to really manipulate values and pointers to values
>> interchangeably.
>> For instance, if I have an int pointer, x, I can't do (12 + x * 2)
>> and
>> get integer math. I get pointer math (if not an error).
>> --bb
>>
>
> is the ref argument type more along the lines you are looking for?
>
> void Foo(ref int a)
>
> I know this is limited to arguments but other than that...
>
>
Yep, exactly like in the argument, but something that's return-able as well.
--bb
More information about the Digitalmars-d
mailing list