Add more CTL content

This commit is contained in:
Justine Tunney 2024-06-28 19:07:35 -07:00
parent 38921dc46b
commit 021c53ba32
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
56 changed files with 1747 additions and 298 deletions

33
ctl/runtime_error.h Normal file
View file

@ -0,0 +1,33 @@
// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*-
// vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi
#ifndef CTL_RUNTIME_ERROR_H_
#define CTL_RUNTIME_ERROR_H_
#include "ctl/string.h"
namespace ctl {
class runtime_error
{
public:
explicit runtime_error(const string& what_arg) : msg_(what_arg)
{
}
explicit runtime_error(const char* what_arg) : msg_(what_arg)
{
}
virtual ~runtime_error() noexcept = default;
virtual const char* what() const noexcept
{
return msg_.c_str();
}
private:
string msg_;
};
} // namespace ctl
#endif // CTL_RUNTIME_ERROR_H_