Consider upgrading to CPP 17 support
shinymerlyn opened this issue · 3 comments
Currently it looks like the CMake project targets CPP11.
Any reason not to upgrade to at least CPP17?
If we did, I'm guessing we'd also need to do some admin on Steam to get the proper runtime installed.
I tried doing a local change in CMake to enable CPP17 support, and it seems the project is still compiling just fine.
I also have features in CPP17 I'd like to use for some string parsing stuff (std::from_chars in particular). I probably can live without it, but the upgrade seems like a reasonable thing to do anyway.
I also don't know if we should instead target an even newer version of C++ than CPP17, or what the highest version that is well supported on all OSs is. It looks like CPP20 could also be a good choice, and that CPP23 might be a bit spotty still, but I'm not a regular enough C++ user to know these things.
Re CPP20, there's this (somewhat older) comment here: #28 (comment)
Maybe CPP20 is still a bit too new? Tho if it is available now and we're upgrading anyway, it would also be something to consider.
Edit:
Although: https://devblogs.microsoft.com/cppblog/cpp20-support-comes-to-cpp-cli/
My 2 cents on CPP20:
I personally am not itching to use the newer features in CPP20. Personally, I'm very happy with roughly C style semantics, but with upgraded libraries that don't do weird and crappy things.
I know vaguely how some of the new CPP20 features work at an abstract level (coroutines, modules, concepts) due to experience with similar features in other languages, but I'd personally avoid them until proven to have good compile times, debuggability, runtime performance, not injecting too much hidden control flow (e.g. throwing exceptions and by default not warning/erroring when you haven't written code to handle them), and being able to adopt it piecemeal instead of having to do an all-or-nothing.
I've switched some of my personal projects to 17. SPIRV-Tools now requires it. Also magic_enum is a very useful library which requires 17. There's some useful std bits like string_view and optional.