This page will attempt to describe features of modern C++ standards (C++17, etc.) supported by the game. For information on building the game, see BuildInstructions.
Supported Compilers
0 A.D. is a cross platform game written primarily in C++ and JavaScript, and as such it has to support multiple compilers with different implemented features. Here are the currently supported compilers for the game:
- GCC 7 or newer
- Clang 6 or newer
- Shipped with Xcode 9.3 on OS X, which is 10.13+ (which also has 10.1)
- Visual Studio 2017
In general, all features up to and including C++17 are usable, except for:
- C++17 std::filesystem is not supported on Apple Clang before the
10.15
SDK. - C++17 std::variant is not supported on Apple Clang before the
10.13
SDK. - C++17 std::any is not supported on Apple Clang before the
10.13
SDK. - C++17 std::shared_mutex is not supported on MSVC when built with the
v141_xp
toolset.
See the following links for details: MSVC / Clang / GCC
Known exceptions are the above features reported by Microsoft:
# | Name | Example |
---|---|---|
P1771R1 | [[nodiscard]] for constructors | |
P0961R1 | Relaxing the structured bindings customization point finding rules | |
P0969R0 | Allowing structured bindings to accessible members | |
P0588R1 | Simplifying implicit lambda capture | |
P1825R0 | Merged wording for P0527R1 and P1155R3, more implicit moves | |
P0929R2 | Checking for abstract class types | |
P0962R2 | Relaxing the range-for loop customization point finding rules | |
P0859R0 | CWG 1581: When are constexpr member functions defined | |
P1009R2 | Array size deduction in new-expressions | |
P1286R2 | Contra CWG DR1778 |
There are nice features and should not be a concern in general. Note though that [[nodiscard]]
cannot be used on constructors.