[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users


This is a follow-up from our [previous discussion](https://discourse.ros.org/t/std-shared-ptr-in-the-geometric-shapes-public-api/395) about public API and C++11. I would like to propose in ROS-M we remove the no std::shared_ptrs in the public API. Remove from REP-003:

> The API of the packages included in desktop-full will not use any C++11-specific feature

This proposal is motivated by annoying shims that have been put in place to allow MoveIt! to use std::shared_ptrs but still hide them externally. Currently in Lunar we are having the [issue](https://github.com/ros-planning/moveit/issues/506) with urdf_model still [using boost](https://github.com/ros/robot_model/blob/kinetic-devel/urdf/include/urdf/model.h#L68) but urdfdom_headers [using std::shared_ptr](https://github.com/ros/robot_model/blob/kinetic-devel/urdf/urdfdom_compatibility.h.in).

I'm not saying it is mandatory everyone switch to shared_ptrs, but it would be nice for authors/maintainers to have the option even if their package is in desktop-full. Thoughts?





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users


Been there, done that. Both with MoveIt and ros_control suffers/suffered (?) from this.

The referred lines were[ added by me](https://github.com/ros/robot_model/pull/153) precisely with the purpose of changing those macros.

There were plenty of code using non-typedef-ed shared_ptr, the above two projects got through the trouble by adapting the macros, I have no knowledge of others.

[There is an effort](https://github.com/ros/robot_model/issues/195) for finally brinding the urdf:: together.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


I think that C++11-compatible compilers are wide-spread enough now (at least on Linux) that using C++11 in the external API should not be a problem.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


@bmagyar the [effort](https://github.com/ros/robot_model/issues/195) you link to does not address boost vs std shared pointers, or C++11, but rather only splitting out the packages into separate repos.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


Yep, that's the main goal there. Getting changes through there hasn't been easy as there are many different things that share the release cycle and dependencies. urdf hasn't been moved yet, you could push the changes in now.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


The previous comment from @tfoote still applies: https://discourse.ros.org/t/std-shared-ptr-in-the-geometric-shapes-public-api/395/5

Changing from `boost` to `std` `shared_ptr` in e.g. ROS-M would require all consumers of that API to update their code. Each package needs to make that decision on its own. But for many "core" ROS packages that might simply not be feasible or desired. So this downside needs to be taken into account when considering such a change.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


That was a thorough comment @tfoote wrote and a good reminder of the rationale. I don't know if ROS-M will still target Ubuntu 16.04, but if not, gcc6 will be on all Ubuntu distros already ([starting with 16.10](https://packages.ubuntu.com/yakkety/gcc)) so the possibility is there.





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/7) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Packaging and Release Management] C++11 std::shared_ptr in public API

Saurabh Bansal via ros-users
In reply to this post by Saurabh Bansal via ros-users


Following the previous targeted platforms, ROS-Melodic will target ubuntu 17.10 (last LTS - 1) and ubuntu 18.04 (last LTS) so they will both have gcc >=6.3.0.
The compiler support is not going to be a blocker here. I think a discussion with the community on the next iteration of REP3 for ROS Melodic is required to find a good compromise between leveraging new features v.s. stability of the APIs for all downstream packages (as pointed out by @tfoote and @dirk-thomas).





---
[Visit Topic](https://discourse.ros.org/t/c-11-std-shared-ptr-in-public-api/1990/8) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>