Is it possible to actually throw the exception with a template, rather than creating a templated function to throw it?
Like this:
template <typename BaseException>
class ExceptionForErrorCode : public BaseException
{
public:
ExceptionForErrorCode(int errorCode, const std::error_category& category);
}
and thrown like that:
throw ExceptionForErrorCode<SystemException>(EINVAL, category);
i think its more syntactically like c++'s intention for exception and it doesnt add to the callstack. But I dont know if I just made up something impossible.
Is it possible to actually throw the exception with a template, rather than creating a templated function to throw it?
i think its more syntactically like c++'s intention for exception and it doesnt add to the callstack. But I dont know if I just made up something impossible.