diff --git a/src/Magnum/Resource.h b/src/Magnum/Resource.h index 01654d629..cd78b01ab 100644 --- a/src/Magnum/Resource.h +++ b/src/Magnum/Resource.h @@ -88,7 +88,10 @@ class ResourceKey: public Utility::MurmurHash2::Digest { * Creates zero key. Note that it is not the same as calling other * constructors with empty string. */ - constexpr ResourceKey() {} + constexpr /*implicit*/ ResourceKey() {} + + /** @brief Construct resource key directly from hashed value */ + explicit ResourceKey(std::size_t key): Utility::MurmurHash2::Digest{Utility::MurmurHash2::Digest::fromByteArray(reinterpret_cast(&key))} {} /** @brief Constructor */ ResourceKey(const std::string& key): Utility::MurmurHash2::Digest(Utility::MurmurHash2()(key)) {}