From 9d28f92072527d5dcf4c31e235fa2e061cf3a175 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 19 Feb 2022 01:43:29 -0600 Subject: [PATCH] [ox/std] Add const char *toStr(const ox::Error&) (synced from 53939a28c6ecd51dca841e847e84b86c664720e6) --- src/ox/std/error.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ox/std/error.hpp b/src/ox/std/error.hpp index 28175844f..67e3d0603 100644 --- a/src/ox/std/error.hpp +++ b/src/ox/std/error.hpp @@ -75,6 +75,11 @@ struct [[nodiscard]] Error { }; +[[nodiscard]] +constexpr auto toStr(const Error &err) noexcept { + return err.msg; +} + struct Exception: public std::exception { const char *msg = nullptr; const char *file = nullptr;