From 32885c185ee6c6b319fe85bb70ada9c04605f94e Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 22 Oct 2012 20:59:06 +0100 Subject: Fix compile error with ancient Boost --- util/string_piece.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util') 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 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 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 -- cgit v1.2.3