Closed afritz1 closed 1 year ago
Changing that line to
set(CMAKE_CXX_STANDARD 20)
seems to work with AppleClang 14 and #include <span>
at least compiles.
As long we don't use language features that are supported in some of the compilers we target but not others, it shouldn't be an issue to switch to C++20 (this chart shows features, but isn't updated for AppleClang 14).
Briefly tested in Ubuntu via WSL2. It was still GCC 9 something and didn't recognize std::span
even with -std=c++2a
, so might wait a bit more for this.
Upgraded to C++20 in dcc8e5542fe3c8b40e5a37dfdb72881a2b63af35 but not sure yet how aggressively I'll reach for the new features. My GCC version in WSL is only 9.4.0 from 2019. In theory this change should be relatively fine because it's a standard from 3 years ago.
Not high priority, just wanted to investigate whether it was worth upgrading to get
std::span
and some other features.Need to make sure this works in a few compilers:
Probably only involves increasing the number in
CMakeLists.txt
: https://github.com/afritz1/OpenTESArena/blob/11a6c53ae53c0f34bba14319c00b7b8726b57477/CMakeLists.txt#L18