The Right Approach to Exceptions

Andrej Mitrovic andrej.mitrovich at
Sat Feb 18 13:07:21 PST 2012

On 2/18/12, Nathan M. Swan <nathanmswan at> wrote:
> It would be nice if there was a mixin template that creates an
> exception class that acts like this; making similar exception
> classes is annoying.

It would be even nicer if we didn't need a mixin for classes that
simply forward the ctor call to the base class ctor:

class FileException : Exception { }   // no-go, have to write a ctor
that forwards to super

AIUI this has something to do with ctors not being virtual. I think
someone mentioned this could be improved one day.

More information about the Digitalmars-d mailing list