diff options
author | graehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-16 09:11:03 +0000 |
---|---|---|
committer | graehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-16 09:11:03 +0000 |
commit | 708e59d0e908b24bac36ec36956ad013268253b0 (patch) | |
tree | b568b7afc5b9012aed8595821c3ef4daa4dbffde /utils/batched_append.h | |
parent | d523a48ff2a7097ec5c33054af82f9395774d2d2 (diff) |
greedy binarization - needs testing, may have broke l2r
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@560 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/batched_append.h')
-rwxr-xr-x | utils/batched_append.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/batched_append.h b/utils/batched_append.h index 842f3209..fe4a12fc 100755 --- a/utils/batched_append.h +++ b/utils/batched_append.h @@ -11,6 +11,7 @@ void batched_append(Vector &v,SRange const& s) { v.insert(v.end(),s.begin(),s.end()); } +//destroys input s, but moves its resources to the end of v. //TODO: use move ctor in c++0x template <class SRange,class Vector> void batched_append_swap(Vector &v,SRange & s) { using namespace std; // to find the right swap via ADL @@ -20,6 +21,7 @@ void batched_append_swap(Vector &v,SRange & s) { typename SRange::iterator si=s.begin(); for (;i<news;++i,++si) swap(v[i],*si); + s.clear(); } #endif |