Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-10-22 23:59:06 +0400
committerKenneth Heafield <github@kheafield.com>2012-10-22 23:59:06 +0400
commit32885c185ee6c6b319fe85bb70ada9c04605f94e (patch)
tree8033634880ba64b82c3f1d9684c3e0bd25025fed /util
parenteb28ea26a83277bb91f48c85b88445a77abf4853 (diff)
Fix compile error with ancient Boost
Diffstat (limited to 'util')
-rw-r--r--util/string_piece.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/string_piece.hh b/util/string_piece.hh
index be6a643d0..ff18744bc 100644
--- a/util/string_piece.hh
+++ b/util/string_piece.hh
@@ -274,10 +274,21 @@ struct StringPieceCompatibleEquals : public std::binary_function<const StringPie
}
};
template <class T> typename T::const_iterator FindStringPiece(const T &t, const StringPiece &key) {
+#if BOOST_VERSION < 104200
+ std::string temp(key.data(), key.size());
+ return t.find(temp);
+#else
return t.find(key, StringPieceCompatibleHash(), StringPieceCompatibleEquals());
+#endif
}
+
template <class T> typename T::iterator FindStringPiece(T &t, const StringPiece &key) {
+#if BOOST_VERSION < 104200
+ std::string temp(key.data(), key.size());
+ return t.find(temp);
+#else
return t.find(key, StringPieceCompatibleHash(), StringPieceCompatibleEquals());
+#endif
}
#endif