mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #290 added CSequence::truncate method
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user