Removes all items from the array. */
| 125 | |
| 126 | /** Removes all items from the array. */ |
| 127 | bool clear() { |
| 128 | if (_usuallyFalse(!MCollection::isMutable())) |
| 129 | return false; |
| 130 | if (_vec.empty()) |
| 131 | return true; |
| 132 | MCollection::mutate(); |
| 133 | _vec.clear(); |
| 134 | return true; |
| 135 | } |
| 136 | |
| 137 | /** Writes the array to an Encoder as a single Value. */ |
| 138 | void encodeTo(Encoder &enc) const { |