From 2a86e91d7b3a9d40fd477b6ad7842f69e188ba37 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 5 Mar 2022 11:37:55 -0600 Subject: [PATCH] [ox/std] Make toStr(Error)'s return type template-able (synced from 1372ea9bc94897bd965c85808ee524e949cc535e) --- src/ox/std/error.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ox/std/error.hpp b/src/ox/std/error.hpp index dd17503b0..274d385e9 100644 --- a/src/ox/std/error.hpp +++ b/src/ox/std/error.hpp @@ -75,9 +75,10 @@ struct [[nodiscard]] Error { }; +template [[nodiscard]] constexpr auto toStr(const Error &err) noexcept { - return err.msg; + return T(err.msg); } struct Exception: public std::exception {