Update to latest C++ Version?

Currently, Exercism uses C++17. Is there a reason not to transfer to a more recent version? There is a lot going on that is worth learning. Usually, I would use the boost equivalent, but that is not really useful here, right?

Maybe @siebenschlaefer knows?

The current policy is that the C++ version in the exercises is tied to the GCC compiler from the oldest supported LTS release of Ubuntu (see issue #438 on GitHub).
I think that’s because it allows the exercises to be solved on older hardware or older systems.

Maybe the currently supported version of c++ should be mentioned in the exercises so that people know that they can’t use std::format for example … :)

Usually that information is available at the track’s docs section
like here for C++. But I think that one is also outdated

That page is not invalid, although incomplete. While you can solve all those exercises with C++14, we officially make the cut at C++17. Due to the base image for the Docker container in the test-runner, you could theoretically use some C++20 (and above) features.

I am not totally happy with that. We tether the track to an Ubuntu version that is compatible with lots of devices, but hinder ourselves from using “modern” C++. I put modern in quotes, as many would define C++11 and above as “modern”; so we are supporting modern C++ concepts.

The longer I maintain this track the more I tend to say: let’s go to the future and take the latest and greatest. C++ is (frustratingly) downward compatible, so any solution that targets an older version should work on a more recent compiler.

With Alpine we could have gcc 14, and thus almost all of C++23 and some of C++26. With Clang 19 we would be a bit out on modules in C++23, but I am not convinced any of this would be a reason not to raise the bar at least to C++20.

Nobody is forced to use those features, all exercises can be used with old versions.

If I (or someone else) ever gets to the point of explaining C++20 (and later) features, we would have to mark those in the description of the concept exercises, but that should not bar us from going forward.

Maybe @siebenschlaefer, @ErikSchierboom, and @ahans can also (re-)evaluate on the version number?

Then by all means update. I don’t think we need to be tied to a specific Ubuntu version, so Alpine should be fine for the test runner too.

3 Likes