diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-06 21:54:29 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-06 21:54:29 +0100 |
commit | aae7393b268407443e79e9ed2fce177fd20593b2 (patch) | |
tree | 21f688720e21ae0960ef869badb2e69fd6f2cf67 /lout/misc.hh | |
parent | 7041a15eb5ff0700b9cbc9eeca62c15183359152 (diff) |
Fixed speed problem of tables rendering.
Diffstat (limited to 'lout/misc.hh')
-rw-r--r-- | lout/misc.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lout/misc.hh b/lout/misc.hh index b362fc2f..a0beb1b6 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -231,6 +231,22 @@ public: assert (this->num > 0); this->array[this->num - 1] = t; } + + /** + * \brief Copies some elements into another vector of the same + * type. + * + * Cannot be used to copy elements within one vector. (For this, + * it would have to be extended to copy backwards in some cases.) + */ + inline void copyTo(SimpleVector<T> *dest, int thisStart = 0, + int thisLast = -1, int destStart = 0) { + assert (dest != this); + if (thisLast == -1) + thisLast = this->size () - 1; + for (int i = thisStart; i <= thisLast; i++) + dest->set (i - thisStart + destStart, get (i)); + } }; /** |