Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MemoryDataStream::reset() method (#2677)
The class already has a `clear()` method but this leaves existing memory allocated. The purpose is to allow re-use of an existing class instance efficiently by reducing memory re-allocations. The new `reset()` method allows the instance to be cleared and also release allocated memory. The new name is consistent with `std::unique_ptr::reset()` usage. A similar thing can be accomplished by using `std::unique_ptr<MemoryDataStream>` however an in-built reset() method makes for cleaner code.
- Loading branch information