diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-09-26 12:43:17 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-09-26 12:43:17 +0300 |
commit | d3c2c0bda54cd8992742953d68dc06d86284d196 (patch) | |
tree | ce9b15ac744e49b0fb18ad353a2d2cd169570785 | |
parent | cc15f070dd3f1c057a972b7bc7f1b667d17dcb58 (diff) |
use std::unordered_set instead of boost::unordered_set. Segfault on boost 1.65.1
-rw-r--r-- | moses2/HypothesisColl.cpp | 2 | ||||
-rw-r--r-- | moses2/HypothesisColl.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/moses2/HypothesisColl.cpp b/moses2/HypothesisColl.cpp index 18046bd4c..39acedced 100644 --- a/moses2/HypothesisColl.cpp +++ b/moses2/HypothesisColl.cpp @@ -254,6 +254,8 @@ void HypothesisColl::Delete(const HypothesisBase *hypo) //cerr << "hypo=" << hypo << " " << m_coll.size() << endl; size_t erased = m_coll.erase(hypo); + //cerr << "erased=" << erased << " " << m_coll.size() << endl; + UTIL_THROW_IF2(erased != 1, "couldn't erase hypo " << hypo); } diff --git a/moses2/HypothesisColl.h b/moses2/HypothesisColl.h index 63a8551ba..f00a2efb0 100644 --- a/moses2/HypothesisColl.h +++ b/moses2/HypothesisColl.h @@ -5,6 +5,7 @@ * Author: hieu */ #pragma once +#include <unordered_set> #include <boost/unordered_set.hpp> #include "HypothesisBase.h" #include "MemPoolAllocator.h" @@ -53,7 +54,7 @@ public: std::string Debug(const System &system) const; protected: - typedef boost::unordered_set<const HypothesisBase*, + typedef std::unordered_set<const HypothesisBase*, UnorderedComparer<HypothesisBase>, UnorderedComparer<HypothesisBase>, MemPoolAllocator<const HypothesisBase*> > _HCType; |