[ox/claw] Add readClaw function that uses an existing instance of T

This commit is contained in:
Gary Talent 2022-05-29 01:19:25 -05:00
parent 40cc222cd8
commit ee851d7013

View File

@ -75,6 +75,11 @@ Result<T> readClaw(const char *buff, std::size_t buffLen) {
return val; return val;
} }
template<typename T>
Error readClaw(const Buffer &buff, T *val) {
return readClaw<T>(buff.data(), buff.size(), val);
}
template<typename T> template<typename T>
Result<T> readClaw(const Buffer &buff) { Result<T> readClaw(const Buffer &buff) {
return readClaw<T>(buff.data(), buff.size()); return readClaw<T>(buff.data(), buff.size());