-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P0966R1 string::reserve() should not shrink #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obligatory "needs test coverage" comment. (There's not much you can do about this for now, but I thought you'd prefer some kind of feedback to no feedback.)
This comment has been minimized.
This comment has been minimized.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good modulo test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'll do the manual work to add a behavioral test for reserve()
and check this into Microsoft-internal git, followed by a merge here. Thanks!
@StephanTLavavej and @CaseyCarter Should I squash the 2 commits into one? |
No need, we'll squash when merging this. You're only one commit behind master and it rebases cleanly. |
Note that while this preserves behavior for I mention this only because ABI compat requires the highest level of care. Finishing the tests now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tests, this is ready to go.
Thanks! Here's the test that I ended up writing:
|
P0966R1 string::reserve() should not shrink (microsoft#176)
Description
Addresses P0966R1 by preventing std::string::reserve() with arguments from shrinking the capacity. Also created deprecation warning, since std::string::reserve() with no arguments is deprecated in C++20.
Resolves #42
Checklist
community PRs will be delayed until the test and CI systems are online.
C++ Working Draft.
_Ugly
as perhttps://eel.is/c++draft/lex.name#3.1 .
verified by an STL maintainer before CI is online, leave this unchecked for
initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft as a reference (and any other cited standards).
If they were derived from a project that's already listed in NOTICE.txt,
that's fine, but please mention it. If they were derived from any other
project (including Boost and libc++, which are not yet listed in
NOTICE.txt), you must mention it here, so we can determine whether the
license is compatible and what else needs to be done.