Proposal 2: Exceptions and @nogc

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 10 16:38:04 PDT 2017


On 4/10/2017 6:00 AM, Jacob Carlborg wrote:
> What exactly does the user have to do to use throw a RC exception instead of a
> GC exception?

case 1:

    throw new Exception(args...);  // the only way an RC exception
				// is ever created

case 2:

    catch (Exception e) {
        ...
        throw e;  // increments `e`s refcount, if `e` is refcounted
    }



More information about the Digitalmars-d mailing list