// Copyright (C) 2024-2025  ilobilo

#pragma once

#include <exception>
#include <string>

namespace std
{
    inline const char *exception::what() const noexcept { return "std::exception"; }
    inline exception::~exception() noexcept { }

    class runtime_error : public exception
    {
        private:
        string _str;

        public:
        runtime_error(const string &what_arg) : _str { what_arg } { }
        runtime_error(const char *what_arg) : _str { what_arg } { }

        runtime_error(const runtime_error &) noexcept = default;
        runtime_error &operator=(const runtime_error &) noexcept = default;

        const char *what() const noexcept { return _str.c_str(); }
    };
} // namespace std