summaryrefslogtreecommitdiff
path: root/klm/util/string_piece.hh
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2013-03-03 12:06:43 +0100
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2013-03-03 12:06:43 +0100
commit6b172ef1b1651e6ccf016b26c9ea94fad6df3152 (patch)
treea62dffda9143a619531be9f96912938659d3a890 /klm/util/string_piece.hh
parent349ee7d5599bb973506c8bbb56926cf9d366b564 (diff)
parent7deec52e8feb1c908a91224f308e8cbd9a170576 (diff)
Merge branch 'master' of github.com:pks/cdec-dtrain
Diffstat (limited to 'klm/util/string_piece.hh')
-rw-r--r--klm/util/string_piece.hh41
1 files changed, 0 insertions, 41 deletions
diff --git a/klm/util/string_piece.hh b/klm/util/string_piece.hh
index 51481646..9cf4c7f6 100644
--- a/klm/util/string_piece.hh
+++ b/klm/util/string_piece.hh
@@ -50,10 +50,6 @@
#include "util/have.hh"
-#ifdef HAVE_BOOST
-#include <boost/functional/hash/hash.hpp>
-#endif // HAVE_BOOST
-
#include <cstring>
#include <iosfwd>
#include <ostream>
@@ -256,46 +252,9 @@ inline std::ostream& operator<<(std::ostream& o, const StringPiece& piece) {
return o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
}
-#ifdef HAVE_BOOST
-inline size_t hash_value(const StringPiece &str) {
- return boost::hash_range(str.data(), str.data() + str.length());
-}
-
-/* Support for lookup of StringPiece in boost::unordered_map<std::string> */
-struct StringPieceCompatibleHash : public std::unary_function<const StringPiece &, size_t> {
- size_t operator()(const StringPiece &str) const {
- return hash_value(str);
- }
-};
-
-struct StringPieceCompatibleEquals : public std::binary_function<const StringPiece &, const std::string &, bool> {
- bool operator()(const StringPiece &first, const StringPiece &second) const {
- return first == second;
- }
-};
-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
-
#ifdef HAVE_ICU
U_NAMESPACE_END
using U_NAMESPACE_QUALIFIER StringPiece;
#endif
-
#endif // BASE_STRING_PIECE_H__