DIP74: Reference Counted Class Objects

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 27 09:35:05 PST 2015


On 2/27/15 9:24 AM, Nick Treleaven wrote:
> On 26/02/2015 22:04, Andrei Alexandrescu wrote:
>> On 2/26/15 2:03 PM, Brian Schott wrote:
>>> The DIP states that "Any attributes are allowed on these methods.", but
>>> later states "The complexity of this code underlies the importance of
>>> making opAddRef and especially opRelease nothrow". Should the DIP
>>> require that these two functions be marked nothrow?
>>
>> It's a liberty still left to user code. -- Andrei
>
> ISTM nothrow would be a sensible starting point. That would simplify
> compiler implementation and avoid invisible inefficiency in user code.
> Shouldn't we wait for a compelling use case for throwing in these
> functions before supporting it?

I don't know of a compelling use case. Note that quite a few of the 
implementations complications remain; the surrounding code may still 
throw. -- Andrei



More information about the Digitalmars-d mailing list