forked from such-gitea/wownero-lws
Update ::wire:: to be closer to Monero variant (#70)
This commit is contained in:
committed by
Lee *!* Clagett
parent
3e0555e07d
commit
e1bd9541f1
@@ -137,28 +137,4 @@ namespace wire
|
||||
\return True if another value to read. */
|
||||
bool key(epee::span<const key_map> map, std::size_t&, std::size_t& index) override final;
|
||||
};
|
||||
|
||||
|
||||
// Don't call `read` directly in this namespace, do it from `wire_read`.
|
||||
|
||||
template<typename T>
|
||||
expect<T> msgpack::from_bytes(epee::byte_slice&& bytes)
|
||||
{
|
||||
msgpack_reader source{std::move(bytes)};
|
||||
return wire_read::to<T>(source);
|
||||
}
|
||||
|
||||
// specialization prevents type "downgrading" to base type in cpp files
|
||||
|
||||
template<typename T>
|
||||
inline void array(msgpack_reader& source, T& dest)
|
||||
{
|
||||
wire_read::array(source, dest);
|
||||
}
|
||||
|
||||
template<typename... T>
|
||||
inline void object(msgpack_reader& source, T... fields)
|
||||
{
|
||||
wire_read::object(source, wire_read::tracker<T>{std::move(fields)}...);
|
||||
}
|
||||
} // wire
|
||||
|
||||
Reference in New Issue
Block a user