I mean it compiled
This commit is contained in:
parent
0ab3f7e808
commit
18de24649a
@ -38,14 +38,9 @@ template<typename StringType, typename ErrorType>
|
||||
struct NBErrorWhatString;
|
||||
|
||||
class ErrorBase_what_str_impl : public std::exception {
|
||||
template <typename T>
|
||||
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<class ErrorType>
|
||||
@ -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<std::wstring>(); }
|
||||
};
|
||||
template <typename ErrorType>
|
||||
const std::string ErrorBase<ErrorType>::type = ErrorType::type;
|
||||
@ -181,7 +176,8 @@ struct NBErrorWhatString<std::wstring, ErrorType> {
|
||||
if (err.trace) {
|
||||
std::wstring trace_msg;
|
||||
if (err.traceIsNBError) {
|
||||
trace_msg = std::static_pointer_cast<ErrorBase_what_str_impl>(err.trace)->template what_str<std::wstring>();
|
||||
// How can I access
|
||||
trace_msg = std::static_pointer_cast<const ErrorBase_what_str_impl>(err.trace)->what_wstr_impl();
|
||||
} else {
|
||||
trace_msg = nb::str_to_wstr(std::string(err.trace->what()));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user