7.2 KiB
7.2 KiB
DXX-Rebirth requires a compiler that implements the C++20 standard. A fully conforming compiler is recommended, but some omissions can be handled by SConf tests that enable a fallback to emulate the feature.
Required C++11 features
DXX-Rebirth code uses C++20 features present in >=clang-14.0 and >=gcc-10.4. Some of these features are probed in the SConf tests so that an error can be reported if the feature is missing. However, since these are considered the minimum supported compiler versions, and existing SConf tests reject older compilers, some C++20 features that are new in gcc-10.4 may be used without a corresponding test in SConf.
These C++11 features are required to build DXX-Rebirth:
- Rvalue references
(
void a(A &&);
) - Variadic templates
(
template <typename... T> class A{};
) auto
-typed variables (auto a = f();
)- Trailing function return type (
auto f() -> int;
)
- Trailing function return type (
- Lambdas
(
f([]{ return 1; });
) decltype()
(typedef decltype(a()) b;
)- Alias templates
(
using A = B; template <typename T> using C = D<T, T>;
) - Null pointer constant
nullptr
(int *i = nullptr;
) - Strongly-typed enums
(
enum class E { ... };
) - Forward declaration for enums
(
enum E; ...; enum E { ... };
) - Generalized constant expressions
(
constexpr int a = 0;
) - Explicit conversion operators
(
explicit operator bool();
) - Defaulted and deleted functions
(
void a(int b) = delete;
) - Unique pointer template std::unique_ptr<T>
(
std::unique_ptr<int> i; std::unique_ptr<int[]> j;
) - Static assertions
std::addressof
- inheriting constructors
- Range-based for
- Reference-qualified methods check that an rvalue which may or may not hold a valid pointer is not used in a context where the caller assumes the rvalue holds a valid pointer.
Required C++14 features
std::index_sequence
is a compile-time sequence of integers.std::exchange
is a utility to update a variable, and yield the value it had before the updatestd::make_unique
is a convenience utility function for constructingstd::unique_ptr
with a managed value.
Required C++17 features
- Fold expressions
- Class template argument deduction
if constexpr
- inline variables
- structured bindings
- initializers in
if
- attribute
[[fallthrough]]
- attribute
[[maybe_unused]]
- attribute
[[nodiscard]]
std::optional
- non-member
std::size()
- non-member
std::data()