Hi,
I’m working on a C++ application which uses some elements of ROS2 (Foxy). So far I’ve been working without issue in a mix of C++17 & C++20, compiling with g++9. I recently tried switching to g++10, to make use of some additional C++20 features, which resulted in some 2000 compilation errors from the ROS2 headers I was using.
As far as I can tell, they mostly boil down to the error:
no class template named ‘rebind’ in ‘class std::allocator’
…which I understand was deprecated in C++20, discussed e.g. here in a ROS 1 context: https://github.com/ros/gencpp/pull/51
There may be other issues too - I certainly haven’t done a deep dive here!
I was just wondering if there are any current plans for C++20 support in ROS2?
We’ll reconsider this in the next release after Galactic.
In the meantime, if there’s a change that can be made to allow it to work with C++20 without breaking compatibility with the other compiler versions we’re supporting, then we’d take a pull request like that.
As @wjwwood said, Galactic is targeting C++17, so most of our effort has been focused around that. We’ll have to discuss C++20 for a future release.
In general, we’re happy to take fixes to make the codebase more compliant with the newer C++ standards, as long as it doesn’t break the earlier standards we are actually targeting.