summaryrefslogtreecommitdiff
path: root/decoder/batched_append.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-12 01:21:10 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-12 01:21:10 +0000
commit32353ed1871dec151d730e4b01d77b6a8d1103e6 (patch)
tree7322c551010843b0d14ca8f6fcd14abf60ac4f31 /decoder/batched_append.h
parente52c3fd7f441b2bd7c1dbf3972de7f672d897745 (diff)
decoder->utils
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@533 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/batched_append.h')
-rwxr-xr-xdecoder/batched_append.h25
1 files changed, 0 insertions, 25 deletions
diff --git a/decoder/batched_append.h b/decoder/batched_append.h
deleted file mode 100755
index 14a6d576..00000000
--- a/decoder/batched_append.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef BATCHED_APPEND_H
-#define BATCHED_APPEND_H
-
-#include <algorithm> //swap
-#include <cstddef>
-
-template <class SRange,class Vector>
-void batched_append(Vector &v,SRange const& s) {
- std::size_t news=v.size()+s.size();
- v.reserve(news);
- v.insert(v.end(),s.begin(),s.end());
-}
-
-template <class SRange,class Vector>
-void batched_append_swap(Vector &v,SRange & s) {
- using namespace std; // to find the right swap
- size_t i=v.size();
- size_t news=i+s.size();
- v.resize(news);
- typename SRange::iterator si=s.begin();
- for (;i<news;++i,++si)
- swap(v[i],*si);
-}
-
-#endif