DIP23 draft: Fixing properties redux

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Feb 5 14:01:39 PST 2013


On 2/5/13 4:45 PM, Steven Schveighoffer wrote:
> On Tue, 05 Feb 2013 15:15:05 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> On 2/5/13 2:05 PM, Steven Schveighoffer wrote:
>>>
>>> I think a cast would be sufficient:
>>>
>>> cast(int *)(&refparam); // understood that a cast is required
>>>
>>> To jump through this machinery to turn a reference into a, um...
>>> reference, seems like a huge waste of code space and resources.
>>
>> The whole point was to avoid using operator &.
>
> The mechanism to avoid it seems overly extravagant (and prone to low
> performance). If you want actually avoid using operator &, then make a
> compiler special function or something.

As I said, there are various solutions. I wrote one that's reasonably 
portable.

> Also, the use of & can still be hidden inside a function.

My point was to not need & such that the function itself can be compiled.

Overall I think this is not the focal issue, the consequences are.


Andrei



More information about the Digitalmars-d mailing list