Don't throw compilation error when NO_ASSERT is used.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-22 12:02:00 +02:00
parent 91b9854932
commit 479a240c6f
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,7 @@ namespace Arbutils::Collections {
} }
inline void Insert(const KeyT& key, const ValueT& value) { 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 #ifndef NO_ASSERT
if (!v.second) if (!v.second)
throw std::logic_error("Key already exists"); throw std::logic_error("Key already exists");

View File

@ -36,6 +36,8 @@
name() : _str(GetEmptyString()), _length(0), _hash(Hash("")) { GetEmptyString()->AddReference(); }; \ name() : _str(GetEmptyString()), _length(0), _hash(Hash("")) { GetEmptyString()->AddReference(); }; \
explicit name(const char* str) : name(str, Length(str)){}; \ explicit name(const char* str) : name(str, Length(str)){}; \
explicit name(const std::string& str) : name(str.c_str(), str.size()){}; \ 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(const name& other) : _str(other.CloneHolder()), _length(other._length), _hash(other._hash) {} \
name& operator=(const name& other) { \ name& operator=(const name& other) { \
if (_str == other._str) { \ if (_str == other._str) { \