From aae7393b268407443e79e9ed2fce177fd20593b2 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Tue, 6 Jan 2015 21:54:29 +0100 Subject: Fixed speed problem of tables rendering. --- lout/misc.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lout') 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 *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)); + } }; /** -- cgit v1.2.3