Const correctness: don't allow non-const iterators exposed from HypothesisCollection.

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@298 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
redpony 2006-07-25 23:28:46 +00:00
parent 2c75d3b10b
commit 985e9bf7a3
2 changed files with 2 additions and 4 deletions

View File

@ -59,7 +59,7 @@ void HypothesisCollection::Add(Hypothesis *hypo)
}
float HypothesisCollection::getBestScore(){
float HypothesisCollection::getBestScore() const{
return m_bestScore;
}

View File

@ -83,14 +83,12 @@ protected:
public:
typedef std::set< Hypothesis*, CompareHypothesisCollection >::iterator iterator;
typedef std::set< Hypothesis*, CompareHypothesisCollection >::const_iterator const_iterator;
iterator begin() { return m_hypos.begin(); }
const_iterator begin() const { return m_hypos.begin(); }
iterator end() { return m_hypos.end(); }
const_iterator end() const { return m_hypos.end(); }
size_t size() const { return m_hypos.size(); }
//returns the score of the best hypothesis
float getBestScore();
float getBestScore() const;
inline HypothesisCollection()
{