Skip to content

Commit

Permalink
chiron: gps: Remove usage of std::shared_ptr<T>::unique()
Browse files Browse the repository at this point in the history
It has been deprecated in c++17 and removed in c++20.
Fixes:
gps/utils/LocIpc.h:119:43: error: no member named 'unique' in
    'std::shared_ptr<int>'
  119 |         if (nullptr != mSocket && mSocket.unique()) {
      |                                   ~~~~~~~ ^
1 error generated.

Change-Id: I10b2be9d07ede68c4083e6a12f2bd5679f603402
  • Loading branch information
mikeNG authored and BYZYB committed Jan 1, 2025
1 parent 3ef94c3 commit 136db4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gps/utils/LocIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class LocIpcSender {
}

inline ~LocIpcSender() {
if (nullptr != mSocket && mSocket.unique()) {
if (nullptr != mSocket && mSocket.use_count() == 1) {
::close(*mSocket);
}
}
Expand Down

0 comments on commit 136db4d

Please sign in to comment.