Added automagic constructor inheritance.

This commit is contained in:
NaifBanana
2025-11-10 00:02:06 -06:00
parent 3ac76f1fac
commit 3f0486b889
2 changed files with 33 additions and 30 deletions
+6 -4
View File
@@ -7,11 +7,13 @@ using namespace nb;
class TestError : public ErrorBase<TestError> {
public:
TestError(unsigned int code, unsigned int line=0, const std::string& filename="")
: ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code)) {}
TestError(unsigned int code, const std::exception& trace, unsigned int line=0, const std::string& filename="")
: ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code), trace, line, filename) {}
//TestError(unsigned int code, unsigned int line=0, const std::string& filename="")
// : ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code)) {}
//TestError(unsigned int code, const std::exception& trace, unsigned int line=0, const std::string& filename="")
// : ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code), trace, line, filename) {}
using ErrorBase<TestError>::ErrorBase;
enum ErrorCodes : unsigned int {
A, B, C, D
};