This chapter gives you a brief overview about the SWIG implementation of the C++20 standard. Work has only just begun on adding C++20 support.
Compatibility note: SWIG-4.1.0 is the first version to support any C++20 features.
SWIG supports the spaceship operator <=> in constant expressions. To simplify handling of the return value type, it is currently treated as an integer rather than std::strong_ordering, etc. In practice we think that should do the right thing in most cases.
SWIG also recognises operator<=> which can be wrapped if renamed. There is not currently any default renaming for the operator or any attempt to automatically map it to a three-way comparison operator in any of the target languages.
SWIG should parse lambda templates, but like non-templated lambdas they aren't currently wrapped.
Destructors that are declared constexpr are parsed and handled like any other constructor. For example:
class DtorA { public: constexpr ~DtorA() {} };