mirror of
https://github.com/momo5502/hypervisor.git
synced 2025-07-05 18:51:53 +00:00
Add sleep callback
This commit is contained in:
38
src/driver/exception.hpp
Normal file
38
src/driver/exception.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "type_traits.hpp"
|
||||
|
||||
namespace std
|
||||
{
|
||||
class exception
|
||||
{
|
||||
public:
|
||||
exception& operator=(const exception& obj) noexcept = default;
|
||||
exception& operator=(exception&& obj) noexcept = default;
|
||||
|
||||
virtual ~exception() = default;
|
||||
virtual const char* what() const noexcept = 0;
|
||||
};
|
||||
|
||||
class runtime_error : public exception
|
||||
{
|
||||
public:
|
||||
runtime_error(const char* message)
|
||||
: message_(message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
runtime_error(const runtime_error& obj) noexcept = default;
|
||||
runtime_error& operator=(const runtime_error& obj) noexcept = default;
|
||||
|
||||
runtime_error(runtime_error&& obj) noexcept = default;
|
||||
runtime_error& operator=(runtime_error&& obj) noexcept = default;
|
||||
|
||||
const char* what() const noexcept override
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
private:
|
||||
const char* message_{};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user