Skip to content

Commit 0695151

Browse files
RaisinTenRafaelGSS
authored andcommitted
src: remove usage of std::shared_ptr<T>::unique()
`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 <[email protected]> PR-URL: #47315 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 75669e9 commit 0695151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_threadsafe_cow-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace node {
77

88
template <typename T>
99
T* CopyOnWrite<T>::write() {
10-
if (!data_.unique()) {
10+
if (data_.use_count() > 1l) {
1111
data_ = std::make_shared<T>(*data_);
1212
}
1313
return data_.get();

0 commit comments

Comments
 (0)