changeset 541:dfb053254455

add copy constructor to SimpleVector
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 10 Nov 2008 17:56:28 +0100
parents 900528cac934
children 09d926b89bfb
files lout/misc.hh
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lout/misc.hh	Sat Nov 08 22:13:58 2008 +0100
+++ b/lout/misc.hh	Mon Nov 10 17:56:28 2008 +0100
@@ -112,6 +112,13 @@
       this->array = NULL;
    }
 
+   inline SimpleVector (const SimpleVector &o) {
+      this->num = o.num;
+      this->numAlloc = o.numAlloc;
+      resize ();
+      memcpy (this->array, o.array, sizeof (T) * num);
+   }
+
    inline ~SimpleVector ()
    {
       if (this->array)