diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-23 00:23:09 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-23 00:25:52 +0400 |
commit | c4416c85faac3383f030471543f17c5eb2d3b895 (patch) | |
tree | 3cf4d6364cba6533a6315c64975365c71c789350 /search | |
parent | 32885c185ee6c6b319fe85bb70ada9c04605f94e (diff) |
Disable incremental search for Boost < 1.42
Diffstat (limited to 'search')
-rw-r--r-- | search/vertex_generator.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/search/vertex_generator.cc b/search/vertex_generator.cc index 0945fe55d..e18010c38 100644 --- a/search/vertex_generator.cc +++ b/search/vertex_generator.cc @@ -4,6 +4,9 @@ #include "search/context.hh" #include "search/edge.hh" +#include <boost/unordered_map.hpp> +#include <boost/version.hpp> + #include <stdint.h> namespace search { @@ -12,6 +15,7 @@ VertexGenerator::VertexGenerator(ContextBase &context, Vertex &gen) : context_(c gen.root_.InitRoot(); } +#if BOOST_VERSION > 104200 namespace { const uint64_t kCompleteAdd = static_cast<uint64_t>(-1); @@ -82,6 +86,18 @@ void AddHypothesis(ContextBase &context, Trie &root, PartialEdge partial) { } // namespace +#else // BOOST_VERSION + +struct Trie { + VertexNode *under; +}; + +void AddHypothesis(ContextBase &context, Trie &root, PartialEdge partial) { + UTIL_THROW(util::Exception, "Upgrade Boost to >= 1.42.0 to use incremental search."); +} + +#endif // BOOST_VERSION + void VertexGenerator::FinishedSearch() { Trie root; root.under = &gen_.root_; |