Add comments.

This commit is contained in:
Victor Zverovich 2014-04-29 06:54:46 -07:00
parent 6798c1704e
commit c1f947f4fb

View File

@ -127,9 +127,12 @@ struct FormatSpec;
namespace internal { namespace internal {
// The number of characters to store in the Array object, representing the
// output buffer, itself to avoid dynamic memory allocation.
enum { INLINE_BUFFER_SIZE = 500 }; enum { INLINE_BUFFER_SIZE = 500 };
#if _SECURE_SCL #if _SECURE_SCL
// Use checked iterator to avoid warnings on MSVC.
template <typename T> template <typename T>
inline stdext::checked_array_iterator<T*> CheckPtr(T *ptr, std::size_t size) { inline stdext::checked_array_iterator<T*> CheckPtr(T *ptr, std::size_t size) {
return stdext::checked_array_iterator<T*>(ptr, size); return stdext::checked_array_iterator<T*>(ptr, size);
@ -203,6 +206,7 @@ class Array {
size_ = new_size; size_ = new_size;
} }
// Reserves space to store at least capacity elements.
void reserve(std::size_t capacity) { void reserve(std::size_t capacity) {
if (capacity > capacity_) if (capacity > capacity_)
Grow(capacity); Grow(capacity);