mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 06:43:14 +01:00
23 lines
338 B
D
23 lines
338 B
D
class E : Exception
|
|
{
|
|
this(char[] msg)
|
|
{
|
|
super(msg);
|
|
}
|
|
|
|
char[] toString()
|
|
{
|
|
return super.toString();
|
|
}
|
|
}
|
|
|
|
extern(C) int printf(char*, ...);
|
|
|
|
void main()
|
|
{
|
|
auto e = new E("hello world");
|
|
auto msg = e.toString();
|
|
printf("message should be: '%.*s'\n", msg.length, msg.ptr);
|
|
throw e;
|
|
}
|