refs #290 added CSequence::truncate method

This commit is contained in:
Mathew Sutcliffe
2014-07-10 16:48:42 +01:00
parent 63edca8ee8
commit 83b552faf6

View File

@@ -200,6 +200,11 @@ namespace BlackMisc
*/
void clear() { if (pimpl()) pimpl()->clear(); }
/*!
* \brief Changes the size of the sequence, if it is bigger than the given size.
*/
void truncate(size_type maxSize) { if (size() > maxSize) { erase(begin() + maxSize, end()); } }
/*!
* \brief Inserts an element into the sequence.
* \return An iterator to the position where value was inserted.