Browse Source

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.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
d3385b54c6
  1. 5
      src/ResourceManager.h

5
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)) {}

Loading…
Cancel
Save