Fixed up setup process, cleaned up repo, and updated README
This commit is contained in:
11
capnp/fixMaybe.h
Normal file
11
capnp/fixMaybe.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "kj/common.h"
|
||||
#include <stdexcept>
|
||||
|
||||
template<typename T>
|
||||
T fixMaybe(::kj::Maybe<T> val) {
|
||||
KJ_IF_MAYBE(new_val, val) {
|
||||
return *new_val;
|
||||
} else {
|
||||
throw std::invalid_argument("member was null");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user