Update ::wire:: to be closer to Monero variant (#70)

This commit is contained in:
Lee *!* Clagett
2023-06-07 09:01:46 -04:00
committed by Lee *!* Clagett
parent 3e0555e07d
commit e1bd9541f1
36 changed files with 992 additions and 587 deletions

View File

@@ -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