Le 20/02/2012 21:17, Nick Sabalausky a écrit :
*However*, I think that:1. That's an insufficient improvement to justify breaking the ultra-common "throw new NameOfException(args)" idiom. 2. The solution fails to cover the *entire* scope of the *real* problem: Classes that need to write boilerplate ctors which merely forward to the base class's ctors. This issue is *not* limited to Exceptions, but Andrei's proposes solution *only* covers the case with Exceptions. A better solution has already been proposed: class AcmeException : Exception { mixin inheritCtors!(); // Actual name open for bikeshedding } Now, yes, this *is* admittedly more boilerplate than: class AcmeException : Exception {}
On IRC we discussed the following solution : class with no defined ctor get default ctor forwarding argument to parent's ctor. If one is defined, this default behaviour disapear.
People were entusiasts about that. But I think we should discuss that in another thread.
