Fix compile error with ancient Boost

This commit is contained in:
Kenneth Heafield 2012-10-22 20:59:06 +01:00
parent eb28ea26a8
commit 32885c185e

View File

@ -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