Browse Source

Removed forward declaration of std::hash.

Aside from the fact that we shouldn't have done it at all, it caused at
least two roblems:

 1. std::hash is by standard defined as struct, but GCC's libstdc++
    defined it as class, causing Clang warning (probably harmless, but
    annoying).
 2. Clang's libcxx implements STL in inline namespace std::__1, which
    causes the forward declaration to define a completely new struct,
    different to std::__1::hash. The actual template specialization
    std::hash<ResourceKey> would then be totally unrelated to
    std::__1::hash, causing compiler error. Removing the forward
    declaration solves this, as it's possible to do the specialization
    without knowing about the inline namespace.
pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
b8f2e345df
  1. 7
      src/Magnum.h

7
src/Magnum.h

@ -412,11 +412,4 @@ class Timeline;
}
namespace std {
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class> struct hash;
#endif
template<> struct hash<Magnum::ResourceKey>;
}
#endif

Loading…
Cancel
Save