diff options
Diffstat (limited to 'lout/misc.hh')
-rw-r--r-- | lout/misc.hh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lout/misc.hh b/lout/misc.hh index 5aafd018..cac3da77 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -223,6 +223,14 @@ public: assert (i >= 0 && this->num - i > 0); this->array[i] = t; } + + /** + * \brief Store an object at the end of the vector. + */ + inline void setLast (T t) { + assert (this->num > 0); + this->array[this->num - 1] = t; + } }; /** @@ -500,6 +508,13 @@ public: inline void set (int i, T t) { *(this->getRef(i)) = t; } + + /** + * \brief Store an object at the end of the vector. + */ + inline void setLast (T t) { + *(this->getLastRef()) = t; + } }; /** |