mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-25 22:14:34 +00:00
feat(kernel/std): implement std::runtime_error and std::length_error
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
5c1c26b135
commit
fd24431eea
@ -84,6 +84,14 @@ namespace std
|
||||
|
||||
class runtime_error : public exception
|
||||
{
|
||||
private:
|
||||
__simple_string what_arg;
|
||||
|
||||
public:
|
||||
// runtime_error(const std::string &what_arg);
|
||||
runtime_error(const char *what_arg) : what_arg(what_arg) {}
|
||||
runtime_error(const runtime_error &other) : what_arg(other.what_arg) {}
|
||||
runtime_error &operator=(const runtime_error &other) = default;
|
||||
};
|
||||
|
||||
class logic_error : public exception
|
||||
@ -126,4 +134,13 @@ namespace std
|
||||
invalid_argument(const invalid_argument &other) = default;
|
||||
invalid_argument &operator=(const invalid_argument &other) = default;
|
||||
};
|
||||
|
||||
class length_error : public logic_error
|
||||
{
|
||||
public:
|
||||
// length_error(const std::string &what_arg);
|
||||
length_error(const char *what_arg) : logic_error(what_arg) {}
|
||||
length_error(const length_error &other) : logic_error(other) {}
|
||||
length_error &operator=(const length_error &other) = default;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user