Will D ever get a reference type?
BCS
ao at pathlink.com
Sun Jul 29 19:58:05 PDT 2007
Reply to Bill,
> 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,
<Nods>
> but something that's return-able as
> well.
>
that's worth thinking about the effects of
> --bb
>
More information about the Digitalmars-d
mailing list