From deab89adf88544cb14464cbe3d872d2d42021dac Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Sat, 29 Aug 2020 16:19:45 +0200 Subject: [PATCH] add missing NGCORE_API and HashArchive & with const value --- libsrc/core/archive.hpp | 5 +++++ libsrc/core/bitarray.hpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 76cb3567..dc381a4a 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -936,6 +936,11 @@ namespace ngcore Archive & operator & (char *& str) override { char* s = str; while(*s != '\0') ApplyHash(*(s++)); return *this; } + // HashArchive can be used in const context + template + Archive & operator& (const T& val) const + { return (*this) & const_cast(val); } + size_t GetHash() const { return hash_value; } private: diff --git a/libsrc/core/bitarray.hpp b/libsrc/core/bitarray.hpp index dff55daf..4005fc81 100644 --- a/libsrc/core/bitarray.hpp +++ b/libsrc/core/bitarray.hpp @@ -131,7 +131,7 @@ public: return Test(i); } - bool operator==(const BitArray& other) const; + NGCORE_API bool operator==(const BitArray& other) const; /// invert all bits NGCORE_API BitArray & Invert (); @@ -147,7 +147,7 @@ public: NGCORE_API size_t NumSet () const; - void DoArchive(Archive& archive); + NGCORE_API void DoArchive(Archive& archive); private: ///