make_unique vs make_shared
Hello,
In the TF2 listener tutorial (c++), the buffer is defined as a std::unique_ptr
whereas the listener is a std::shared_ptr
.
tf_buffer_ = std::make_unique<tf2_ros::Buffer>(this->get_clock());
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(*tf_buffer_);
Is this intentional? I.e. is there a specific reason for the listener to be a std::shared_ptr
, or could it just as well also have been a std::unique_ptr
?