strict_not_null for unique_ptr#1179
Merged
carsonRadtke merged 1 commit intomicrosoft:mainfrom Dec 26, 2024
Merged
Conversation
75964df to
53a1e8c
Compare
carsonRadtke
approved these changes
Dec 23, 2024
Member
carsonRadtke
left a comment
There was a problem hiding this comment.
Thanks for fixing the issue and adding well-written tests. Everything looks good!
I will merge once the conflicts are resolved.
- `strict_not_null<std::unique_ptr<int>>{ std::make_unique<int>()}` failed to compile
- `strict_not_null` ctor needs to move the passed `unique_ptr`, not copy
- Copied `not_null` `TestNotNullConstructors` for `strict_not_null`
- The `noexcept` specifiers on the `strict_not_null` and `not_null` constructors were out of sync.
- Added unit test for `not_null<unique_ptr<T>>` and for `strict_not_null<unique_ptr<T>>`
- Added unit test for `gsl::swap` for two `strict_not_null`
- Added unit test for `gsl::swap` for `not_null` and `strict_not_null`
53a1e8c to
4e06ebe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
strict_not_null<std::unique_ptr<int>>{ std::make_unique<int>()}failed to compilestrict_not_nullctor needs to move the passedunique_ptr, not copynot_nullTestNotNullConstructorsforstrict_not_nullnoexceptspecifiers on thestrict_not_nullandnot_nullconstructors were out of sync.not_null<unique_ptr<T>>and forstrict_not_null<unique_ptr<T>>gsl::swapfor twostrict_not_nullgsl::swapfornot_nullandstrict_not_null