PSP emulator written in D

KennyTM~ kennytm at gmail.com
Tue Aug 9 23:55:34 PDT 2011


On Aug 10, 11 05:15, bearophile wrote:
> This again shows that some common basic exceptions are needed in Phobos:
> http://code.google.com/p/pspemu/source/browse/trunk/src/pspemu/Exceptions.d

These exceptions are not common or basic. I think it's better to make 
constructors inheritable when there are no new members, or add something 
like this to std.exception:

---------------
mixin template ExceptionConstructors() {
     this(string msg, string file = __FILE__, size_t line = __LINE__, 
Throwable next = null) {
         super(msg, file, line, next);
     }
     this(string msg, Throwable next, string file = __FILE__, size_t 
line = __LINE__) {
         super(msg, next, file, line);
     }
}
---------------

So those custom exceptions can be created as

class TimeoutException : Exception {
    mixin ExceptionConstructors;
}


More information about the Digitalmars-d mailing list