Перенос страниц

This commit is contained in:
Alexander Zhirov 2023-03-05 15:30:34 +03:00
parent 4d57446057
commit 4c954c9186
129 changed files with 14 additions and 15 deletions

View file

@ -0,0 +1,29 @@
/**
* 1. Объявите класс, который наследуется от Exception.
* 2. Создайте конструктор, который принимает, как минимум, два параметра: string file и
* size_t line, со значениями по умолчанию __FILE__ и __LINE__ соответственно.
* 3. Попросите конструктора переслать аргументы конструктору исключения (super).
* 4. Используйте свое исключение.
*/
class MyException : Exception
{
this (string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
super(message, file, line, next);
}
}
void main()
{
import std.stdio;
try
{
throw new MyException("message here");
}
catch(MyException e)
{
writeln("caught ", e);
}
}