aboutsummaryrefslogtreecommitdiff
path: root/include/Result.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-22 17:34:55 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-18 15:21:48 +0100
commitb5f06b6c4cd07f3073897af32626b9b21a4d2ef8 (patch)
tree3ccfb3f7776730520ed28679652c8dec5c4c126d /include/Result.hpp
parentbfd21732b35a3856b1f72c826816c2857710fcb3 (diff)
Fix vertex and pixel shader
Remove pixel shader code from shader program
Diffstat (limited to 'include/Result.hpp')
-rw-r--r--include/Result.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/Result.hpp b/include/Result.hpp
index 316e45a..749d381 100644
--- a/include/Result.hpp
+++ b/include/Result.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <cassert>
namespace amalgine
{
@@ -28,16 +29,22 @@ namespace amalgine
static Result<T> Err(const Result<OtherType> &otherResult)
{
Result<T> result;
- result.errorMsg = otherResult.errorMsg;
- result.errorCode = otherResult.errorCode;
+ result.errorMsg = otherResult.getErrorMsg();
+ result.errorCode = otherResult.getErrorCode();
return result;
}
bool isOk() const { return errorCode == 0; }
bool isErr() const { return !isOk(); }
operator bool() const { return isOk(); }
+ T& unwrap()
+ {
+ assert(isOk());
+ return data;
+ }
const std::string& getErrorMsg() const { return errorMsg; }
+ int getErrorCode() const { return errorCode; }
private:
Result(){}
private: