On Wednesday, 25 June 2014 at 09:54:16 UTC, bearophile wrote:
Sean Campbell:
but which one is better conforms to the d style?
Both are valid. Use the second when you want a more precise
exception in your code, this is common in larger programs.
Keep in mind that you can allocate an excepti
Sean Campbell:
but which one is better conforms to the d style?
Both are valid. Use the second when you want a more precise
exception in your code, this is common in larger programs.
Keep in mind that you can allocate an exception in a point and
throw it in another. This reduces the runtim
i know you can use both
throw new Exception(msg);
and
module test;
class testException {
this (string msg) {
super("some error info : "~msg);
}
}
throw new testException(msg);
but which one is better conforms to the d style?