From 6c71bd46af8d72d4fe55ed6460f5410bb67ad383 Mon Sep 17 00:00:00 2001 From: NaifBanana <30419422+NaifBanana@users.noreply.github.com> Date: Fri, 10 Apr 2026 00:41:01 -0500 Subject: [PATCH] I mean it compiled --- engine/NBCore/Errors.hpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/engine/NBCore/Errors.hpp b/engine/NBCore/Errors.hpp index 6517341..1f636f6 100644 --- a/engine/NBCore/Errors.hpp +++ b/engine/NBCore/Errors.hpp @@ -38,14 +38,9 @@ template struct NBErrorWhatString; class ErrorBase_what_str_impl : public std::exception { - template - T what_str() const; - - template <> - virtual std::wstring what_str() const; - - template<> - virtual std::string what_str() const; +public: + virtual std::string what_str_impl() const = 0; + virtual std::wstring what_wstr_impl() const = 0; }; template @@ -165,8 +160,8 @@ protected: filename_ ) {} - std::string (ErrorBase::*_trace_what_str)(); - std::wstring (ErrorBase::*_trace_what_wstr)(); + std::string what_str_impl() const override final { return what_str(); } + std::wstring what_wstr_impl() const override final { return what_str(); } }; template const std::string ErrorBase::type = ErrorType::type; @@ -181,7 +176,8 @@ struct NBErrorWhatString { if (err.trace) { std::wstring trace_msg; if (err.traceIsNBError) { - trace_msg = std::static_pointer_cast(err.trace)->template what_str(); + // How can I access + trace_msg = std::static_pointer_cast(err.trace)->what_wstr_impl(); } else { trace_msg = nb::str_to_wstr(std::string(err.trace->what())); }