diff --git a/BAN/include/BAN/ByteSpan.h b/BAN/include/BAN/ByteSpan.h index 06b53161..94426240 100644 --- a/BAN/include/BAN/ByteSpan.h +++ b/BAN/include/BAN/ByteSpan.h @@ -25,11 +25,26 @@ namespace BAN : m_data(other.data()) , m_size(other.size()) { } + ByteSpanGeneral(ByteSpanGeneral&& other) + : m_data(other.data()) + , m_size(other.size()) + { + other.m_data = nullptr; + other.m_size = 0; + } template ByteSpanGeneral(const ByteSpanGeneral& other) requires(CONST) : m_data(other.data()) , m_size(other.size()) { } + template + ByteSpanGeneral(ByteSpanGeneral&& other) requires(CONST) + : m_data(other.data()) + , m_size(other.size()) + { + other.m_data = nullptr; + other.m_size = 0; + } ByteSpanGeneral(Span other) : m_data(other.data()) , m_size(other.size()) @@ -134,6 +149,8 @@ namespace BAN private: value_type* m_data { nullptr }; size_type m_size { 0 }; + + friend class ByteSpanGeneral; }; using ByteSpan = ByteSpanGeneral;