From 78348bcddd18fa7a25541595576bef1df4fc4022 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Thu, 22 Jun 2023 09:15:12 +0200 Subject: wallet-rpc: restore from multisig seed --- contrib/epee/include/span.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'contrib/epee/include/span.h') diff --git a/contrib/epee/include/span.h b/contrib/epee/include/span.h index 99c2ebb4f..23bd51f8c 100644 --- a/contrib/epee/include/span.h +++ b/contrib/epee/include/span.h @@ -147,6 +147,16 @@ namespace epee return {reinterpret_cast(src.data()), src.size_bytes()}; } + //! \return `span` from a STL compatible `src`. + template + constexpr span to_mut_byte_span(T& src) + { + using value_type = typename T::value_type; + static_assert(!std::is_empty(), "empty value types will not work -> sizeof == 1"); + static_assert(!has_padding(), "source value type may have padding"); + return {reinterpret_cast(src.data()), src.size() * sizeof(value_type)}; + } + //! \return `span` which represents the bytes at `&src`. template span as_byte_span(const T& src) noexcept -- cgit v1.2.3