Checked vs unchecked exceptions

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 27 19:25:04 PDT 2017


On Wednesday, 28 June 2017 at 02:09:40 UTC, Moritz Maxeiner wrote:
>
> ---
> static assert (throwsExactly!(foo, AException, BException));
> void foo() { ... }
> ---

One could even go a bit farther and implement a mixin template 
using `typeof(this)` and do:

---
void foo()
{
     mixin ThrowsExactly!(AException, BException);
}
---


More information about the Digitalmars-d mailing list