RFC: reference counted Throwable

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 19 17:27:38 PDT 2014


On Friday, 19 September 2014 at 15:32:38 UTC, Andrei Alexandrescu 
wrote:
> First, there must be some compiler flag -nogc or something, 
> which triggers the RC exceptions. All modules of an application 
> must be compiled with this flag if it is to work (such that one 
> module can throw an exception caught by the other). Of course a 
> lot of refinement needs to be added here (what happens if one 
> tries to link modules built with and without -nogc, allowing 
> people to detect the flag programmatically by using 
> version(nogc) etc).

Won't using -nogc preclude using this in Phobos/Druntime?

How about instead of a new switch, change the name mangling of 
anything that inherits from RCObject? E.g. 'C' is used for 
classes, 'R' could be used for reference-counting classes. Then 
an ordinary version block can be used to switch between the two.


More information about the Digitalmars-d mailing list