zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2.05k stars 593 forks source link

Set minimum C++ standard to c++17 #1624

Closed bernardnormier closed 7 months ago

bernardnormier commented 10 months ago

For Ice 3.8, the min C++ standard for our entire C++ source base should be c++17. As a result, we can use c++17 features (including standard library features such as std::optional) anywhere without conditional code.

This does not mean we always build everything with -std:c++17.

I propose that with each compiler we build with the highest stable -std option: c++17, c++20, c++23 ... the highest stable std with a stable ABI. See for example: https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/

This way, we can use newer feature in the code base with conditionals. And we'll get warnings in the event we use features deprecated in c++20/23 etc.

pepone commented 7 months ago

We are currently building with:

C++20 macOS Clang15 or greater C++20 Visual Studio 2023 C++17 G++11