diff --git a/src/lib/error.hpp b/src/lib/error.hpp index 4987cec..1d6099d 100644 --- a/src/lib/error.hpp +++ b/src/lib/error.hpp @@ -23,37 +23,31 @@ struct ErrorOr { uint8_t errorCode; T value; - ErrorOr(); - ErrorOr(T); - ErrorOr(bool, uint8_t); - ErrorOr(bool, uint8_t, T); + ErrorOr() { + this->isError = false; + this->errorCode = 0; + } + + ErrorOr(T value) { + this->isError = false; + this->errorCode = 0; + this->value = value; + } + + ErrorOr(bool isError, uint8_t errorCode) { + this->isError = isError; + this->errorCode = errorCode; + } + + ErrorOr(bool isError, uint8_t errorCode, T value) { + this->isError = isError; + this->errorCode = errorCode; + this->value = value; + } }; -template -ErrorOr::ErrorOr() { - this->isError = false; - this->errorCode = 0; -} -template -ErrorOr::ErrorOr(T value) { - this->isError = false; - this->errorCode = 0; - this->value = value; -} -template -ErrorOr::ErrorOr(bool isError, uint8_t errorCode) { - this->isError = isError; - this->errorCode = errorCode; -} - -template -ErrorOr::ErrorOr(bool isError, uint8_t errorCode, T value) { - this->isError = isError; - this->errorCode = errorCode; - this->value = value; -} namespace ErrorCodes { // These are all arbitrary values used to assign error codes to different