Skip to content
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

std::shared_ptr<T>::unique was removed in C++20 #47311

Closed
targos opened this issue Mar 30, 2023 · 3 comments
Closed

std::shared_ptr<T>::unique was removed in C++20 #47311

targos opened this issue Mar 30, 2023 · 3 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.

Comments

@targos
Copy link
Member

targos commented Mar 30, 2023

Code:

if (!data_.unique()) {

Found in: #45427 (comment)

Refs: https://en.cppreference.com/w/cpp/memory/shared_ptr/unique

@nodejs/cpp-reviewers

@targos targos added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 30, 2023
@gengjiawen

This comment was marked as outdated.

RaisinTen added a commit to RaisinTen/node that referenced this issue Mar 30, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in C++20.

Fixes: nodejs#47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@RaisinTen
Copy link
Contributor

I think #47315 might fix this.

RaisinTen added a commit to RaisinTen/node that referenced this issue Mar 30, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: nodejs#47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@gengjiawen
Copy link
Member

I tested #47315 on VS2022, it works.

targos pushed a commit to targos/node that referenced this issue Mar 31, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: nodejs#47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 5, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 5, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 6, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 7, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 8, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 13, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams pushed a commit that referenced this issue Jul 6, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: #47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this issue Jul 6, 2023
`std::shared_ptr<T>::unique()` has been removed in C++20, so this change
uses `std::shared_ptr<T>::use_count()` instead which is available in
C++20.

Fixes: nodejs#47311
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: nodejs#47315
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants