diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-08-22 13:16:24 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-08-22 13:16:24 +0400 |
commit | c4dc57f8a3d04390cb4757894a6d596be43b7aa7 (patch) | |
tree | 99cf1bd184d680bcfa5173399c95a72b1b4eaf94 /moses/ScoreComponentCollection.h | |
parent | 6b5c1a09e4cd27bc8adc00094729efa7e1bbf1bf (diff) |
swap
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r-- | moses/ScoreComponentCollection.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h index a7c4eb2b7..4d12e4286 100644 --- a/moses/ScoreComponentCollection.h +++ b/moses/ScoreComponentCollection.h @@ -63,8 +63,11 @@ namespace Moses class ScoreComponentCollection { friend std::ostream& operator<<(std::ostream& os, const ScoreComponentCollection& rhs); + friend void swap(ScoreComponentCollection &first, ScoreComponentCollection &second); + private: FVector m_scores; + typedef std::pair<size_t,size_t> IndexPair; typedef std::map<const FeatureFunction*,IndexPair> ScoreIndexMap; static ScoreIndexMap s_scoreIndexes; @@ -414,5 +417,9 @@ struct SCCPlus { } }; +inline void swap(ScoreComponentCollection &first, ScoreComponentCollection &second) { + swap(first.m_scores, second.m_scores); +} + } #endif |