summaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-09-20 21:54:08 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-09-20 21:54:08 +0200
commit9cda79aa8efd5defbf845bcfb70b1688ef57d681 (patch)
tree19f180fee51744c0aa56b7f820ed984738436ed0 /lout
parent97a315bf349a757927f4a55a6cbe186f20d384af (diff)
add SimpleVector::detachArray()
Diffstat (limited to 'lout')
-rw-r--r--lout/misc.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lout/misc.hh b/lout/misc.hh
index fe5cdcd5..437d229e 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -149,6 +149,14 @@ public:
inline T* getArray() { return array; }
+ inline T* detachArray() {
+ T* arr = array;
+ array = NULL;
+ numAlloc = 0;
+ num = 0;
+ return arr;
+ }
+
/**
* \brief Increase the vector size by one.
*