From b05ca8cb807e28319ca5e6b370e086216004567c Mon Sep 17 00:00:00 2001 From: Ulrich Germann Date: Thu, 2 Jul 2015 18:06:55 +0100 Subject: Fixes to make code compile on various versions of gcc. --- moses/TargetPhrase.cpp | 2 +- moses/TargetPhrase.h | 2 +- moses/TranslationModel/UG/mm/ug_mm_2d_table.h | 2 +- moses/TranslationModel/UG/mm/ug_mm_ttrack.h | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp index fc7af9687..251a9db7d 100644 --- a/moses/TargetPhrase.cpp +++ b/moses/TargetPhrase.cpp @@ -181,7 +181,7 @@ bool TargetPhrase::HasTtaskSPtr() const { return m_ttask_flag; } -const ttasksptr& TargetPhrase::GetTtask() const { +const ttasksptr TargetPhrase::GetTtask() const { return m_ttask.lock(); } diff --git a/moses/TargetPhrase.h b/moses/TargetPhrase.h index 460dcc33f..554ac2793 100644 --- a/moses/TargetPhrase.h +++ b/moses/TargetPhrase.h @@ -92,7 +92,7 @@ public: TargetPhrase(ttasksptr &ttask, const PhraseDictionary *pt = NULL); TargetPhrase(ttasksptr &ttask, std::string out_string, const PhraseDictionary *pt = NULL); explicit TargetPhrase(ttasksptr &ttask, const Phrase &targetPhrase, const PhraseDictionary *pt); - const ttasksptr& GetTtask() const; + ttasksptr const GetTtask() const; bool HasTtaskSPtr() const; ~TargetPhrase(); diff --git a/moses/TranslationModel/UG/mm/ug_mm_2d_table.h b/moses/TranslationModel/UG/mm/ug_mm_2d_table.h index e2284382e..0ae16895b 100644 --- a/moses/TranslationModel/UG/mm/ug_mm_2d_table.h +++ b/moses/TranslationModel/UG/mm/ug_mm_2d_table.h @@ -103,7 +103,7 @@ namespace ugdiss operator[](ID key) const { if (start==stop) return INIT(0); - Cell const* c = lower_bound(start,stop,key); + Cell const* c = std::lower_bound(start,stop,key); return (c != stop && c->id == key ? c->val : INIT(0)); } diff --git a/moses/TranslationModel/UG/mm/ug_mm_ttrack.h b/moses/TranslationModel/UG/mm/ug_mm_ttrack.h index 91167822d..b87d638b2 100644 --- a/moses/TranslationModel/UG/mm/ug_mm_ttrack.h +++ b/moses/TranslationModel/UG/mm/ug_mm_ttrack.h @@ -21,6 +21,7 @@ #include "ug_ttrack_base.h" #include "num_read_write.h" #include "ug_load_primer.h" +#include "ug_tsa_base.h" namespace ugdiss { @@ -193,7 +194,7 @@ namespace ugdiss findSid(TKN const* t) const { id_type tokenPos = t-data; - id_type const* p = upper_bound(index,index+this->numSent,tokenPos); + id_type const* p = std::upper_bound(index,index+this->numSent,tokenPos); assert(p>index); return p-index-1; } @@ -203,7 +204,7 @@ namespace ugdiss mmTtrack:: findSid(id_type tokenPos) const { - id_type const* p = upper_bound(index,index+this->numSent,tokenPos); + id_type const* p = std::upper_bound(index,index+this->numSent,tokenPos); assert(p>index); return p-index-1; } -- cgit v1.2.3