aboutsummaryrefslogtreecommitdiff
path: root/Doc/Manual
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2013-11-16 00:13:38 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-11-20 19:12:16 +0000
commite566c5fa7f4b8af527c9f13f6eabd84bfc38a897 (patch)
tree023b9064b725cedcb9b65a2087eedf71ffadfb64 /Doc/Manual
parent5e6fb595dd4f6b1766c3c7eeca97c5223a5d7aad (diff)
downloadswig-e566c5fa7f4b8af527c9f13f6eabd84bfc38a897.tar.gz
Add support for parsing C++11 =delete and =default
Although this was documented as working, it wasn't implemented %typemap(default) failed without the idstring changes Add some C tests using the C++ keyword delete
Diffstat (limited to 'Doc/Manual')
-rw-r--r--Doc/Manual/CPlusPlus11.html22
1 files changed, 13 insertions, 9 deletions
diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html
index 3caec748e..95d748791 100644
--- a/Doc/Manual/CPlusPlus11.html
+++ b/Doc/Manual/CPlusPlus11.html
@@ -33,7 +33,7 @@
<li><a href="#CPlusPlus11_New_string_literals">New string literals</a>
<li><a href="#CPlusPlus11_User_defined_literals">User-defined literals</a>
<li><a href="#CPlusPlus11_Thread_local_storage">Thread-local storage</a>
-<li><a href="#CPlusPlus11_Defaulting/deleting_of_standard_functions_on_C++_objects">Defaulting/deleting of standard functions on C++ objects</a>
+<li><a href="#CPlusPlus11_Defaulted_deleted">Defaulting/deleting of standard functions on C++ objects</a>
<li><a href="#CPlusPlus11_Type_long_long_int">Type long long int</a>
<li><a href="#CPlusPlus11_Static_assertions">Static assertions</a>
<li><a href="#CPlusPlus11_Allow_sizeof_to_work_on_members_of_classes_without_an_explicit_object">Allow sizeof to work on members of classes without an explicit object</a>
@@ -739,23 +739,27 @@ A variable will be thread local if accessed from different threads from the targ
same way that it will be thread local if accessed from C++ code.
</p>
-<H3><a name="CPlusPlus11_Defaulting/deleting_of_standard_functions_on_C++_objects"></a>7.2.21 Defaulting/deleting of standard functions on C++ objects</H3>
+<H3><a name="CPlusPlus11_defaulted_deleted"></a>7.2.21 Explicitly defaulted functions and deleted functions</H3>
-<p>SWIG correctly parses the <tt>= delete</tt> and <tt>= default</tt>
-keywords. For example:</p>
+<p>SWIG handles explicitly defaulted functions, that is, <tt>= default</tt> added to a function declaration. Deleted definitions, which are also called deleted functions, have <tt>= delete</tt> added to the function declaration.
+For example:</p>
<div class="code"><pre>
struct NonCopyable {
NonCopyable&amp; operator=(const NonCopyable&amp;) = delete; /* Removes operator= */
- NonCopyable(const NonCopyable&amp;) = delete; /* Removed copy constructor */
- NonCopyable() = default; /* Explicitly allows the empty constructor */
- void *operator new(std::size_t) = delete; /* Removes new NonCopyable */
+ NonCopyable(const NonCopyable&amp;) = delete; /* Removed copy constructor */
+ NonCopyable() = default; /* Explicitly allows the empty constructor */
+ void *operator new(std::size_t) = delete; /* Removes new NonCopyable */
};
</pre></div>
-<p>This feature is specific to C++ only. The defaulting/deleting is currently ignored, because SWIG
-automatically produces wrappers for special constructors and operators specific to the target language.</p>
+<p>
+Wrappers for deleted functions will not be available in the target language.
+Wrappers for defaulted functions will of course be available in the target language.
+Explicitly defaulted functions have no direct effect for SWIG wrapping as the declaration is handled
+much like any other method declaration parsed by SWIG.
+</p>
<H3><a name="CPlusPlus11_Type_long_long_int"></a>7.2.22 Type long long int</H3>