From f097f6473095fa04ff52ac7ee33a8dc435144a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 29 Nov 2023 20:27:38 +0100 Subject: Avoid storing zero references and objects --- include/erebos/storage.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/erebos') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 3feb22b..48bedd7 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -174,6 +174,7 @@ public: PartialRef & operator=(PartialRef &&) = default; static PartialRef create(const PartialStorage &, const Digest &); + static PartialRef zcreate(const PartialStorage &); const Digest & digest() const; @@ -234,6 +235,7 @@ private: ptr(ptr) {} public: + RecordT(): RecordT(std::vector {}) {} RecordT(const std::vector &); RecordT(std::vector &&); std::vector encode() const; @@ -420,6 +422,8 @@ public: std::vector encode() const; static ObjectT load(const typename S::Ref &); + operator bool() const; + std::optional> asRecord() const; std::optional asBlob() const; -- cgit v1.2.3