Skip to content

Commit

Permalink
Deleted copy constructor and assignment for FutureAndRequestId
Browse files Browse the repository at this point in the history
Signed-off-by: Barry Xu <[email protected]>
  • Loading branch information
Barry-Xu-2018 committed Oct 27, 2023
1 parent 5a12ea5 commit cac70b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rclcpp/include/rclcpp/generic_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ class GenericClient : public ClientBase

/// See std::future::share().
SharedFuture share() noexcept {return this->future.share();}

/// Move constructor.
FutureAndRequestId(FutureAndRequestId && other) noexcept = default;
/// Deleted copy constructor, each instance is a unique owner of the future.
FutureAndRequestId(const FutureAndRequestId & other) = delete;
/// Move assignment.
FutureAndRequestId & operator=(FutureAndRequestId && other) noexcept = default;
/// Deleted copy assignment, each instance is a unique owner of the future.
FutureAndRequestId & operator=(const FutureAndRequestId & other) = delete;
/// Destructor.
~FutureAndRequestId() = default;
};

GenericClient(
Expand Down

0 comments on commit cac70b0

Please sign in to comment.