From d3385b54c6f33d6c831f6a17482be337f03b558c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 19 Nov 2012 12:04:37 +0100 Subject: [PATCH] Default constructor of ResourceKey creates zero key. When resource access later fails on not loaded data, zero key in assertion message might hint that the Resource instance was default-constructed and thus not loaded at all. --- src/ResourceManager.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ResourceManager.h b/src/ResourceManager.h index bae717ad6..22a7097e4 100644 --- a/src/ResourceManager.h +++ b/src/ResourceManager.h @@ -95,9 +95,10 @@ class ResourceKey: public Corrade::Utility::MurmurHash2::Digest { /** * @brief Default constructor * - * The same as calling other constructors with empty string. + * Creates zero key. Note that it is not the same as calling other + * constructors with empty string. */ - inline ResourceKey(): Corrade::Utility::MurmurHash2::Digest(Corrade::Utility::MurmurHash2()("")) {} + inline constexpr ResourceKey() {} /** @brief Constructor */ inline ResourceKey(const std::string& key): Corrade::Utility::MurmurHash2::Digest(Corrade::Utility::MurmurHash2()(key)) {}