Dynamic API almost done. Reading is complete.
Still need to flesh out the writing part of the API. init functions are making it very messy at the moment.
This commit is contained in:
11
fixMaybe.h
Normal file
11
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