From 479a240c6f4177b842f12645b0d431b9cd3ca4f2 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 22 Apr 2020 12:02:00 +0200 Subject: [PATCH] Don't throw compilation error when NO_ASSERT is used. --- src/Collections/Dictionary.hpp | 2 +- src/__ConstStringCore.hpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Collections/Dictionary.hpp b/src/Collections/Dictionary.hpp index 5918856..97031c8 100644 --- a/src/Collections/Dictionary.hpp +++ b/src/Collections/Dictionary.hpp @@ -20,7 +20,7 @@ namespace Arbutils::Collections { } inline void Insert(const KeyT& key, const ValueT& value) { - auto v = _map.insert({key, value}); + [[maybe_unused]] auto v = _map.insert({key, value}); #ifndef NO_ASSERT if (!v.second) throw std::logic_error("Key already exists"); diff --git a/src/__ConstStringCore.hpp b/src/__ConstStringCore.hpp index 2989c19..9f3bb9c 100644 --- a/src/__ConstStringCore.hpp +++ b/src/__ConstStringCore.hpp @@ -36,6 +36,8 @@ name() : _str(GetEmptyString()), _length(0), _hash(Hash("")) { GetEmptyString()->AddReference(); }; \ explicit name(const char* str) : name(str, Length(str)){}; \ explicit name(const std::string& str) : name(str.c_str(), str.size()){}; \ + \ + /* Copy operators */ \ name(const name& other) : _str(other.CloneHolder()), _length(other._length), _hash(other._hash) {} \ name& operator=(const name& other) { \ if (_str == other._str) { \