-
Notifications
You must be signed in to change notification settings - Fork 82
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
buffer::set_final_data
accepts weak_ptr<T>
, not <T[]>
#1011
base: main
Are you sure you want to change the base?
Conversation
56f1948
to
b9520a5
Compare
Agree. For example, for |
One more reviewer please (total 2 for this please) |
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.
I wonder whether this should be a specification fix to accept smart pointers on T[]
also.
@@ -63,21 +63,19 @@ class buffer_storage_test { | |||
|
|||
// Case 3 - Weak pointer | |||
std::shared_ptr<T[]> data_shared_ptr(new T[size]); | |||
std::weak_ptr<T[]> data_final3 = data_shared_ptr; | |||
std::shared_ptr<T> data_shared_ptr_alias(data_shared_ptr, |
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.
Why doing this, since you initialize it also with the pointer from the shared pointer handling the ownership? 🤔
OK, after more thoughts you do this to have the same shared pointer but returning a pointer of the array decay.
You could add a comment. 😄
See [4.7.2.1]:
Not sure if this was different in an earlier spec revision.