aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.ucl/errc.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-07-01 17:07:04 +0100
committerLexi Winter <lexi@le-fay.org>2025-07-01 17:07:04 +0100
commit2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 (patch)
tree54d37ffadf8e677938d9b7a28e4e9b71be1e75c1 /nihil.ucl/errc.cc
parent36427c0966faa7aecd586b397ed9b845f18172f5 (diff)
downloadnihil-2e2d1bd3b6c7776b77c33b94f30ead89367a71e6.tar.gz
nihil-2e2d1bd3b6c7776b77c33b94f30ead89367a71e6.tar.bz2
add nihil.std
Diffstat (limited to 'nihil.ucl/errc.cc')
-rw-r--r--nihil.ucl/errc.cc49
1 files changed, 0 insertions, 49 deletions
diff --git a/nihil.ucl/errc.cc b/nihil.ucl/errc.cc
deleted file mode 100644
index 0b65b86..0000000
--- a/nihil.ucl/errc.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This source code is released into the public domain.
- */
-
-module;
-
-#include <string>
-#include <system_error>
-
-module nihil.ucl;
-
-namespace nihil::ucl {
-
-struct ucl_error_category final : std::error_category {
- auto name() const noexcept -> char const * override;
- auto message(int err) const -> std::string override;
-};
-
-auto ucl_category() noexcept -> std::error_category &
-{
- static auto category = ucl_error_category();
- return category;
-}
-
-auto make_error_condition(errc ec) -> std::error_condition
-{
- return {static_cast<int>(ec), ucl_category()};
-}
-
-auto ucl_error_category::name() const noexcept -> char const *
-{
- return "nihil.ucl";
-}
-
-auto ucl_error_category::message(int err) const -> std::string
-{
- switch (static_cast<errc>(err)) {
- case errc::no_error:
- return "No error";
- case errc::failed_to_create_object:
- return "Failed to create UCL object";
- case errc::type_mismatch:
- return "UCL type does not match expected type";
- default:
- return "Undefined error";
- }
-}
-
-} // namespace nihil::ucl