aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee
diff options
context:
space:
mode:
authorjeffro256 <jeffro256@tutanota.com>2023-06-22 09:15:12 +0200
committerjeffro256 <jeffro256@tutanota.com>2023-07-28 12:17:14 -0500
commit45b52de28ecde0d31134f5cb6a1be29524ab2853 (patch)
tree20abe8ac628afa409f7e7dadce8e9499f21f67a8 /contrib/epee
parentMerge pull request #8842 (diff)
downloadmonero-45b52de28ecde0d31134f5cb6a1be29524ab2853.tar.xz
wallet-rpc: restore from multisig seed
Diffstat (limited to 'contrib/epee')
-rw-r--r--contrib/epee/include/span.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/epee/include/span.h b/contrib/epee/include/span.h
index 82936a777..bbd5d690c 100644
--- a/contrib/epee/include/span.h
+++ b/contrib/epee/include/span.h
@@ -147,6 +147,16 @@ namespace epee
return {reinterpret_cast<const std::uint8_t*>(src.data()), src.size_bytes()};
}
+ //! \return `span<std::uint8_t>` from a STL compatible `src`.
+ template<typename T>
+ constexpr span<std::uint8_t> to_mut_byte_span(T& src)
+ {
+ using value_type = typename T::value_type;
+ static_assert(!std::is_empty<value_type>(), "empty value types will not work -> sizeof == 1");
+ static_assert(!has_padding<value_type>(), "source value type may have padding");
+ return {reinterpret_cast<std::uint8_t*>(src.data()), src.size() * sizeof(value_type)};
+ }
+
//! \return `span<const std::uint8_t>` which represents the bytes at `&src`.
template<typename T>
span<const std::uint8_t> as_byte_span(const T& src) noexcept