bwidgets/inc/basic_widgets/core/type/exception.hpp

23 lines
450 B
C++
Raw Normal View History

#ifndef BWIDGETS_EXCEPTION_HPP
#define BWIDGETS_EXCEPTION_HPP
2021-08-14 16:45:30 +02:00
#include <stdexcept>
#include <basic_widgets/core/type/concepts.hpp>
2021-08-06 14:22:56 +02:00
namespace bwidgets
{
2021-08-23 23:50:14 +02:00
// Base type for custom runtime errors.
class BaseException : std::runtime_error
{
2021-08-23 23:50:14 +02:00
protected:
using runtime_error::runtime_error;
};
2021-08-23 23:50:14 +02:00
// T derives from BaseException.
template<typename T>
concept Exception = std::derived_from<T, BaseException>;
}
#endif