mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 00:12:27 +03:00
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:
parent
2c75d3b10b
commit
985e9bf7a3
@ -59,7 +59,7 @@ void HypothesisCollection::Add(Hypothesis *hypo)
|
||||
}
|
||||
|
||||
|
||||
float HypothesisCollection::getBestScore(){
|
||||
float HypothesisCollection::getBestScore() const{
|
||||
return m_bestScore;
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user