diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-22 23:59:06 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-22 23:59:06 +0400 |
commit | 32885c185ee6c6b319fe85bb70ada9c04605f94e (patch) | |
tree | 8033634880ba64b82c3f1d9684c3e0bd25025fed /util | |
parent | eb28ea26a83277bb91f48c85b88445a77abf4853 (diff) |
Fix compile error with ancient Boost
Diffstat (limited to 'util')
-rw-r--r-- | util/string_piece.hh | 11 |
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 |