patch-src_include_fst_sparse-tuple-weight_h 975 B

123456789101112131415161718192021222324252627282930313233
  1. $OpenBSD: patch-src_include_fst_sparse-tuple-weight_h,v 1.1 2017/05/07 20:00:26 espie Exp $
  2. Index: src/include/fst/sparse-tuple-weight.h
  3. --- src/include/fst/sparse-tuple-weight.h.orig
  4. +++ src/include/fst/sparse-tuple-weight.h
  5. @@ -33,9 +33,17 @@
  6. #include<string>
  7. #include<list>
  8. #include<stack>
  9. +#if defined(__clang__) || __cplusplus >= 201103L
  10. +#include <unordered_map>
  11. +using std::unordered_map;
  12. +using std::unordered_multimap;
  13. +using std::hash;
  14. +#else
  15. #include<tr1/unordered_map>
  16. using std::tr1::unordered_map;
  17. using std::tr1::unordered_multimap;
  18. +using std::tr1::hash;
  19. +#endif
  20. #include <fst/weight.h>
  21. @@ -140,7 +148,7 @@ class SparseTupleWeight {
  22. // Assumes H() function exists for the hash of the key value
  23. size_t Hash() const {
  24. uint64 h = 0;
  25. - std::tr1::hash<K> H;
  26. + hash<K> H;
  27. for (SparseTupleWeightIterator<W, K> it(*this); !it.Done(); it.Next()) {
  28. h = 5 * h + H(it.Value().first);
  29. h = 13 * h + it.Value().second.Hash();