Implement P0966 - string::reserve should not shrink

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347789 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-11-28 18:18:34 +00:00
parent 087f065cb0
commit 7593e799d2
3 changed files with 13 additions and 4 deletions

View File

@@ -956,9 +956,11 @@ public:
void resize(size_type __n, value_type __c);
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
void reserve(size_type __res_arg);
_LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);
void reserve(size_type __res_arg = 0);
_LIBCPP_INLINE_VISIBILITY
void reserve() _NOEXCEPT {reserve(0);}
_LIBCPP_INLINE_VISIBILITY
void shrink_to_fit() _NOEXCEPT {reserve();}
_LIBCPP_INLINE_VISIBILITY