mirror of https://github.com/swig/swig
73 lines
2.2 KiB
HTML
73 lines
2.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>SWIG and C++20</title>
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
</head>
|
|
|
|
<body bgcolor="#ffffff">
|
|
<H1><a name="CPlusPlus20">10 SWIG and C++20</a></H1>
|
|
<!-- INDEX -->
|
|
<div class="sectiontoc">
|
|
<ul>
|
|
<li><a href="#CPlusPlus20_introduction">Introduction</a>
|
|
<li><a href="#CPlusPlus20_core_language_changes">Core language changes</a>
|
|
<ul>
|
|
<li><a href="#CPlusPlus20_spaceship_operator">Spaceship operator</a>
|
|
<li><a href="#CPlusPlus20_lambda_templates">Lambda templates</a>
|
|
</ul>
|
|
<li><a href="#CPlusPlus20_standard_library_changes">Standard library changes</a>
|
|
</ul>
|
|
</div>
|
|
<!-- INDEX -->
|
|
|
|
|
|
|
|
<H2><a name="CPlusPlus20_introduction">10.1 Introduction</a></H2>
|
|
|
|
|
|
<p>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.
|
|
</p>
|
|
|
|
<p>
|
|
<b>Compatibility note:</b> SWIG-4.1.0 is the first version to support any C++20 features.
|
|
</p>
|
|
|
|
<H2><a name="CPlusPlus20_core_language_changes">10.2 Core language changes</a></H2>
|
|
|
|
|
|
<H3><a name="CPlusPlus20_spaceship_operator">10.2.1 Spaceship operator</a></H3>
|
|
|
|
|
|
<p>
|
|
SWIG supports the spaceship operator <tt><=></tt> in constant
|
|
expressions. To simplify handling of the return value type, it is currently
|
|
treated as an integer rather than <tt>std::strong_ordering</tt>, etc.
|
|
In practice we think that should do the right thing in most cases.
|
|
</p>
|
|
|
|
<p>
|
|
SWIG also recognises <tt>operator<=></tt> 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.
|
|
</p>
|
|
|
|
<H3><a name="CPlusPlus20_lambda_templates">10.2.2 Lambda templates</a></H3>
|
|
|
|
|
|
<p>
|
|
SWIG should parse lambda templates, but like
|
|
<a href="CPlusPlus11.html#CPlusPlus11_lambda_functions_and_expressions">
|
|
non-templated lambdas</a> they aren't currently wrapped.
|
|
</p>
|
|
|
|
<H2><a name="CPlusPlus20_standard_library_changes">10.3 Standard library changes</a></H2>
|
|
|
|
|
|
</body>
|
|
</html>
|