From f3976e3c06ef57671e823953a8cc27c30547da6d Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 6 Jul 2018 18:46:59 -0400 Subject: ... --- include/salticidae/stream.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/salticidae/stream.h') diff --git a/include/salticidae/stream.h b/include/salticidae/stream.h index a5bc74c..fdbf967 100644 --- a/include/salticidae/stream.h +++ b/include/salticidae/stream.h @@ -170,7 +170,7 @@ class DataStream { return bytearray_t(buffer.begin() + offset, buffer.end()); } - operator bytearray_t () const && { + operator bytearray_t () && { return std::move(buffer); } @@ -223,7 +223,7 @@ class Blob { } bool operator!=(const Blob &other) const { - return !(data == other); + return !(*this == other); } size_t cheap_hash() const { return *data; } @@ -250,6 +250,12 @@ class Blob { } loaded = true; } + + operator bytearray_t () const & { + DataStream s; + s << *this; + return std::move(s); + } }; const size_t ENT_HASH_LENGTH = 256 / 8; -- cgit v1.2.3