Merge remote branch 'upstream/master' into perl5-directors-minimal
This commit is contained in:
commit
0db26ffee2
11 changed files with 427 additions and 128 deletions
|
|
@ -10,45 +10,46 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="#CPlusPlus11_Introduction">Introduction</a>
|
||||
<li><a href="#CPlusPlus11_Core_language_changes">Core language changes</a>
|
||||
<li><a href="#CPlusPlus11_introduction">Introduction</a>
|
||||
<li><a href="#CPlusPlus11_core_language_changes">Core language changes</a>
|
||||
<ul>
|
||||
<li><a href="#CPlusPlus11_Rvalue_reference_and_move_semantics">Rvalue reference and move semantics</a>
|
||||
<li><a href="#CPlusPlus11_Generalized_constant_expressions">Generalized constant expressions</a>
|
||||
<li><a href="#CPlusPlus11_Extern_template">Extern template</a>
|
||||
<li><a href="#CPlusPlus11_Initializer_lists">Initializer lists</a>
|
||||
<li><a href="#CPlusPlus11_Uniform_initialization">Uniform initialization</a>
|
||||
<li><a href="#CPlusPlus11_Type_inference">Type inference</a>
|
||||
<li><a href="#CPlusPlus11_Range_based_for_loop">Range-based for-loop</a>
|
||||
<li><a href="#CPlusPlus11_Lambda_functions_and_expressions">Lambda functions and expressions</a>
|
||||
<li><a href="#CPlusPlus11_Alternate_function_syntax">Alternate function syntax</a>
|
||||
<li><a href="#CPlusPlus11_Object_construction_improvement">Object construction improvement</a>
|
||||
<li><a href="#CPlusPlus11_Null_pointer_constant">Null pointer constant</a>
|
||||
<li><a href="#CPlusPlus11_Strongly_typed_enumerations">Strongly typed enumerations</a>
|
||||
<li><a href="#CPlusPlus11_Double_angle_brackets">Double angle brackets</a>
|
||||
<li><a href="#CPlusPlus11_Explicit_conversion_operators">Explicit conversion operators</a>
|
||||
<li><a href="#CPlusPlus11_Alias_templates">Alias templates</a>
|
||||
<li><a href="#CPlusPlus11_Unrestricted_unions">Unrestricted unions</a>
|
||||
<li><a href="#CPlusPlus11_Variadic_templates">Variadic templates</a>
|
||||
<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_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>
|
||||
<li><a href="#CPlusPlus11_rvalue_reference_and_move_semantics">Rvalue reference and move semantics</a>
|
||||
<li><a href="#CPlusPlus11_generalized_constant_expressions">Generalized constant expressions</a>
|
||||
<li><a href="#CPlusPlus11_extern_template">Extern template</a>
|
||||
<li><a href="#CPlusPlus11_initializer_lists">Initializer lists</a>
|
||||
<li><a href="#CPlusPlus11_uniform_initialization">Uniform initialization</a>
|
||||
<li><a href="#CPlusPlus11_type_inference">Type inference</a>
|
||||
<li><a href="#CPlusPlus11_range_based_for_loop">Range-based for-loop</a>
|
||||
<li><a href="#CPlusPlus11_lambda_functions_and_expressions">Lambda functions and expressions</a>
|
||||
<li><a href="#CPlusPlus11_alternate_function_syntax">Alternate function syntax</a>
|
||||
<li><a href="#CPlusPlus11_object_construction_improvement">Object construction improvement</a>
|
||||
<li><a href="#CPlusPlus11_null_pointer_constant">Null pointer constant</a>
|
||||
<li><a href="#CPlusPlus11_strongly_typed_enumerations">Strongly typed enumerations</a>
|
||||
<li><a href="#CPlusPlus11_double_angle_brackets">Double angle brackets</a>
|
||||
<li><a href="#CPlusPlus11_explicit_conversion_operators">Explicit conversion operators</a>
|
||||
<li><a href="#CPlusPlus11_alias_templates">Alias templates</a>
|
||||
<li><a href="#CPlusPlus11_unrestricted_unions">Unrestricted unions</a>
|
||||
<li><a href="#CPlusPlus11_variadic_templates">Variadic templates</a>
|
||||
<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_defaulted_deleted">Explicitly defaulted functions and deleted functions</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>
|
||||
<li><a href="#CPlusPlus11_noexcept">Exception specifications and noexcept</a>
|
||||
</ul>
|
||||
<li><a href="#CPlusPlus11_Standard_library_changes">Standard library changes</a>
|
||||
<li><a href="#CPlusPlus11_standard_library_changes">Standard library changes</a>
|
||||
<ul>
|
||||
<li><a href="#CPlusPlus11_Threading_facilities">Threading facilities</a>
|
||||
<li><a href="#CPlusPlus11_Tuple_types">Tuple types and hash tables</a>
|
||||
<li><a href="#CPlusPlus11_Regular_expressions">Regular expressions</a>
|
||||
<li><a href="#CPlusPlus11_General_purpose_smart_pointers">General-purpose smart pointers</a>
|
||||
<li><a href="#CPlusPlus11_Extensible_random_number_facility">Extensible random number facility</a>
|
||||
<li><a href="#CPlusPlus11_Wrapper_reference">Wrapper reference</a>
|
||||
<li><a href="#CPlusPlus11_Polymorphous_wrappers_for_function_objects">Polymorphous wrappers for function objects</a>
|
||||
<li><a href="#CPlusPlus11_Type_traits_for_metaprogramming">Type traits for metaprogramming</a>
|
||||
<li><a href="#CPlusPlus11_Uniform_method_for_computing_return_type_of_function_objects">Uniform method for computing return type of function objects</a>
|
||||
<li><a href="#CPlusPlus11_threading_facilities">Threading facilities</a>
|
||||
<li><a href="#CPlusPlus11_tuple_types">Tuple types and hash tables</a>
|
||||
<li><a href="#CPlusPlus11_regular_expressions">Regular expressions</a>
|
||||
<li><a href="#CPlusPlus11_general_purpose_smart_pointers">General-purpose smart pointers</a>
|
||||
<li><a href="#CPlusPlus11_extensible_random_number_facility">Extensible random number facility</a>
|
||||
<li><a href="#CPlusPlus11_wrapper_reference">Wrapper reference</a>
|
||||
<li><a href="#CPlusPlus11_polymorphous_wrappers_for_function_objects">Polymorphous wrappers for function objects</a>
|
||||
<li><a href="#CPlusPlus11_type_traits_for_metaprogramming">Type traits for metaprogramming</a>
|
||||
<li><a href="#CPlusPlus11_uniform_method_for_computing_return_type_of_function_objects">Uniform method for computing return type of function objects</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="CPlusPlus11_Introduction"></a>7.1 Introduction</H2>
|
||||
<H2><a name="CPlusPlus11_introduction"></a>7.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>This chapter gives you a brief overview about the SWIG
|
||||
|
|
@ -68,10 +69,10 @@ Google Summer of Code 2009 period.</p>
|
|||
new STL types (unordered_ containers, result_of, tuples) are not supported
|
||||
yet.</p>
|
||||
|
||||
<H2><a name="CPlusPlus11_Core_language_changes"></a>7.2 Core language changes</H2>
|
||||
<H2><a name="CPlusPlus11_core_language_changes"></a>7.2 Core language changes</H2>
|
||||
|
||||
|
||||
<H3><a name="CPlusPlus11_Rvalue_reference_and_move_semantics"></a>7.2.1 Rvalue reference and move semantics</H3>
|
||||
<H3><a name="CPlusPlus11_rvalue_reference_and_move_semantics"></a>7.2.1 Rvalue reference and move semantics</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the new operator && the same as the reference operator &.</p>
|
||||
|
|
@ -87,7 +88,7 @@ class MyClass {
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Generalized_constant_expressions"></a>7.2.2 Generalized constant expressions</H3>
|
||||
<H3><a name="CPlusPlus11_generalized_constant_expressions"></a>7.2.2 Generalized constant expressions</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the keyword <tt>constexpr</tt>, but ignores its functionality. Constant functions cannot be used as constants.</p>
|
||||
|
|
@ -105,7 +106,7 @@ constexpr int myConstFunc() { return MY_CONST; }
|
|||
const int a = MY_CONST; // ok
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Extern_template"></a>7.2.3 Extern template</H3>
|
||||
<H3><a name="CPlusPlus11_extern_template"></a>7.2.3 Extern template</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the keywords <tt>extern template</tt>. However, the explicit template instantiation is not used by SWIG, a <tt>%template</tt> is still required.</p>
|
||||
|
|
@ -123,7 +124,8 @@ public:
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Initializer_lists"></a>7.2.4 Initializer lists</H3>
|
||||
<H3><a name="CPlusPlus11_initializer_lists"></a>7.2.4 Initializer lists</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Initializer lists are very much a C++ compiler construct and are not very accessible from wrappers as
|
||||
|
|
@ -254,7 +256,7 @@ Note that the default typemap for <tt>std::initializer_list</tt> does nothing bu
|
|||
and hence any user supplied typemaps will override it and suppress the warning.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Uniform_initialization"></a>7.2.5 Uniform initialization</H3>
|
||||
<H3><a name="CPlusPlus11_uniform_initialization"></a>7.2.5 Uniform initialization</H3>
|
||||
|
||||
|
||||
<p>The curly brackets {} for member initialization are fully
|
||||
|
|
@ -287,7 +289,7 @@ AltStruct var2{2, 4.3}; // calls the constructor
|
|||
142.15
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Type_inference"></a>7.2.6 Type inference</H3>
|
||||
<H3><a name="CPlusPlus11_type_inference"></a>7.2.6 Type inference</H3>
|
||||
|
||||
|
||||
<p>SWIG supports <tt>decltype()</tt> with some limitations. Single
|
||||
|
|
@ -304,13 +306,13 @@ int i; int j;
|
|||
decltype(i+j) k; // syntax error
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Range_based_for_loop"></a>7.2.7 Range-based for-loop</H3>
|
||||
<H3><a name="CPlusPlus11_range_based_for_loop"></a>7.2.7 Range-based for-loop</H3>
|
||||
|
||||
|
||||
<p>This feature is part of the implementation block only. SWIG
|
||||
ignores it.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Lambda_functions_and_expressions"></a>7.2.8 Lambda functions and expressions</H3>
|
||||
<H3><a name="CPlusPlus11_lambda_functions_and_expressions"></a>7.2.8 Lambda functions and expressions</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses most of the Lambda functions syntax. For example:</p>
|
||||
|
|
@ -336,7 +338,7 @@ auto six = [](int x, int y) { return x+y; }(4, 2);
|
|||
Better support should be available in a later release.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Alternate_function_syntax"></a>7.2.9 Alternate function syntax</H3>
|
||||
<H3><a name="CPlusPlus11_alternate_function_syntax"></a>7.2.9 Alternate function syntax</H3>
|
||||
|
||||
|
||||
<p>SWIG fully supports the new definition of functions. For example:</p>
|
||||
|
|
@ -371,7 +373,7 @@ auto SomeStruct::FuncName(int x, int y) -> int {
|
|||
auto square(float a, float b) -> decltype(a);
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Object_construction_improvement"></a>7.2.10 Object construction improvement</H3>
|
||||
<H3><a name="CPlusPlus11_object_construction_improvement"></a>7.2.10 Object construction improvement</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -412,12 +414,12 @@ class DerivedClass: public BaseClass {
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Null_pointer_constant"></a>7.2.11 Null pointer constant</H3>
|
||||
<H3><a name="CPlusPlus11_null_pointer_constant"></a>7.2.11 Null pointer constant</H3>
|
||||
|
||||
|
||||
<p>The <tt>nullptr</tt> constant is largely unimportant in wrappers. In the few places it has an effect, it is treated like <tt>NULL</tt>.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Strongly_typed_enumerations"></a>7.2.12 Strongly typed enumerations</H3>
|
||||
<H3><a name="CPlusPlus11_strongly_typed_enumerations"></a>7.2.12 Strongly typed enumerations</H3>
|
||||
|
||||
|
||||
<p>SWIG parses the new <tt>enum class</tt> syntax and forward declarator for the enums:</p>
|
||||
|
|
@ -468,7 +470,7 @@ class AllColors {
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Double_angle_brackets"></a>7.2.13 Double angle brackets</H3>
|
||||
<H3><a name="CPlusPlus11_double_angle_brackets"></a>7.2.13 Double angle brackets</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the symbols >> as closing the
|
||||
|
|
@ -479,7 +481,7 @@ shift operator >> otherwise.</p>
|
|||
std::vector<std::vector<int>> myIntTable;
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Explicit_conversion_operators"></a>7.2.14 Explicit conversion operators</H3>
|
||||
<H3><a name="CPlusPlus11_explicit_conversion_operators"></a>7.2.14 Explicit conversion operators</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the keyword <tt>explicit</tt> both for operators and constructors.
|
||||
|
|
@ -515,7 +517,8 @@ SWIG target languages, because all use their own facilities (eg. classes Cloneab
|
|||
to achieve particular copy and compare behaviours.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Alias_templates"></a>7.2.15 Alias templates</H3>
|
||||
<H3><a name="CPlusPlus11_alias_templates"></a>7.2.15 Alias templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
The following is an example of an alias template:
|
||||
|
|
@ -567,7 +570,7 @@ example.i:17: Warning 341: The 'using' keyword in type aliasing is not fully sup
|
|||
typedef void (*PFD)(double); // The old style
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Unrestricted_unions"></a>7.2.16 Unrestricted unions</H3>
|
||||
<H3><a name="CPlusPlus11_unrestricted_unions"></a>7.2.16 Unrestricted unions</H3>
|
||||
|
||||
|
||||
<p>SWIG fully supports any type inside a union even if it does not
|
||||
|
|
@ -581,7 +584,7 @@ struct point {
|
|||
int x_, y_;
|
||||
};
|
||||
|
||||
#include <new> // For placement 'new' in the constructor below
|
||||
#include <new> // For placement 'new' in the constructor below
|
||||
union P {
|
||||
int z;
|
||||
double w;
|
||||
|
|
@ -593,7 +596,7 @@ union P {
|
|||
} p1;
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Variadic_templates"></a>7.2.17 Variadic templates</H3>
|
||||
<H3><a name="CPlusPlus11_variadic_templates"></a>7.2.17 Variadic templates</H3>
|
||||
|
||||
|
||||
<p>SWIG supports the variadic templates syntax (inside the <>
|
||||
|
|
@ -628,7 +631,7 @@ const int SIZE = sizeof...(ClassName<int, int>);
|
|||
In the above example <tt>SIZE</tt> is of course wrapped as a constant.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_New_string_literals"></a>7.2.18 New string literals</H3>
|
||||
<H3><a name="CPlusPlus11_new_string_literals"></a>7.2.18 New string literals</H3>
|
||||
|
||||
|
||||
<p>SWIG supports unicode string constants and raw string literals.</p>
|
||||
|
|
@ -652,7 +655,7 @@ const char32_t *ii = UR"XXX(I'm a "raw UTF-32" \ string.)XXX";
|
|||
<p>Note: SWIG currently incorrectly parses the odd number of double quotes
|
||||
inside the string due to SWIG's C++ preprocessor.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_User_defined_literals"></a>7.2.19 User-defined literals</H3>
|
||||
<H3><a name="CPlusPlus11_user_defined_literals"></a>7.2.19 User-defined literals</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -719,7 +722,7 @@ OutputType var2 = 1234_suffix;
|
|||
OutputType var3 = 3.1416_suffix;
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Thread_local_storage"></a>7.2.20 Thread-local storage</H3>
|
||||
<H3><a name="CPlusPlus11_thread_local_storage"></a>7.2.20 Thread-local storage</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses the <tt>thread_local</tt> keyword. For example, variable
|
||||
|
|
@ -739,30 +742,34 @@ 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& operator=(const NonCopyable&) = delete; /* Removes operator= */
|
||||
NonCopyable(const NonCopyable&) = delete; /* Removed copy constructor */
|
||||
NonCopyable() = default; /* Explicitly allows the empty constructor */
|
||||
void *operator new(std::size_t) = delete; /* Removes new NonCopyable */
|
||||
NonCopyable(const NonCopyable&) = 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>
|
||||
<H3><a name="CPlusPlus11_type_long_long_int"></a>7.2.22 Type long long int</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses and uses the new <tt>long long</tt> type already introduced in C99 some time ago.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Static_assertions"></a>7.2.23 Static assertions</H3>
|
||||
<H3><a name="CPlusPlus11_static_assertions"></a>7.2.23 Static assertions</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly parses and calls the new <tt>static_assert</tt> function.</p>
|
||||
|
|
@ -774,7 +781,7 @@ struct Check {
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Allow_sizeof_to_work_on_members_of_classes_without_an_explicit_object"></a>7.2.24 Allow sizeof to work on members of classes without an explicit object</H3>
|
||||
<H3><a name="CPlusPlus11_allow_sizeof_to_work_on_members_of_classes_without_an_explicit_object"></a>7.2.24 Allow sizeof to work on members of classes without an explicit object</H3>
|
||||
|
||||
|
||||
<p>SWIG correctly calls the sizeof() on types as well as on the
|
||||
|
|
@ -794,28 +801,45 @@ const int SIZE = sizeof(A::member); // does not work with C++03. Okay with C++11
|
|||
8
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="CPlusPlus11_Standard_library_changes"></a>7.3 Standard library changes</H2>
|
||||
<H3><a name="CPlusPlus11_noexcept"></a>7.2.25 Exception specifications and noexcept</H3>
|
||||
|
||||
|
||||
<H3><a name="CPlusPlus11_Threading_facilities"></a>7.3.1 Threading facilities</H3>
|
||||
<p>
|
||||
C++11 added in the noexcept specification to exception specifications to indicate that a function simply may or may not throw an exception, without actually naming any exception.
|
||||
SWIG understands these, although there isn't any useful way that this information can be taken advantage of by target languages,
|
||||
so it is as good as ignored during the wrapping process.
|
||||
Below are some examples of noexcept in function declarations:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
static void noex1() noexcept;
|
||||
int noex2(int) noexcept(true);
|
||||
int noex3(int, bool) noexcept(false);
|
||||
</pre></div>
|
||||
|
||||
|
||||
<H2><a name="CPlusPlus11_standard_library_changes"></a>7.3 Standard library changes</H2>
|
||||
|
||||
|
||||
<H3><a name="CPlusPlus11_threading_facilities"></a>7.3.1 Threading facilities</H3>
|
||||
|
||||
|
||||
<p>SWIG does not currently wrap or use any of the new threading
|
||||
classes introduced (thread, mutex, locks, condition variables, task). The main reason is that
|
||||
SWIG target languages offer their own threading facilities that do not rely on C++.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Tuple_types"></a>7.3.2 Tuple types and hash tables</H3>
|
||||
<H3><a name="CPlusPlus11_tuple_types"></a>7.3.2 Tuple types and hash tables</H3>
|
||||
|
||||
|
||||
<p>SWIG does not wrap the new tuple types and the unordered_ container classes yet. Variadic template support is working so it is possible to
|
||||
include the tuple header file; it is parsed without any problems.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Regular_expressions"></a>7.3.3 Regular expressions</H3>
|
||||
<H3><a name="CPlusPlus11_regular_expressions"></a>7.3.3 Regular expressions</H3>
|
||||
|
||||
|
||||
<p>SWIG does not wrap the new C++11 regular expressions classes, because the SWIG target languages use their own facilities for this.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_General_purpose_smart_pointers"></a>7.3.4 General-purpose smart pointers</H3>
|
||||
<H3><a name="CPlusPlus11_general_purpose_smart_pointers"></a>7.3.4 General-purpose smart pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -823,12 +847,12 @@ SWIG provides special smart pointer handling for <tt>std::tr1::shared_ptr</tt> i
|
|||
There is no special smart pointer handling available for <tt>std::weak_ptr</tt> and <tt>std::unique_ptr</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Extensible_random_number_facility"></a>7.3.5 Extensible random number facility</H3>
|
||||
<H3><a name="CPlusPlus11_extensible_random_number_facility"></a>7.3.5 Extensible random number facility</H3>
|
||||
|
||||
|
||||
<p>This feature extends and standardizes the standard library only and does not effect the C++ language and SWIG.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Wrapper_reference"></a>7.3.6 Wrapper reference</H3>
|
||||
<H3><a name="CPlusPlus11_wrapper_reference"></a>7.3.6 Wrapper reference</H3>
|
||||
|
||||
|
||||
<p>The new ref and cref classes are used to instantiate a parameter as a reference of a template function. For example:</p>
|
||||
|
|
@ -853,7 +877,7 @@ int main() {
|
|||
|
||||
<p>The ref and cref classes are not wrapped by SWIG because the SWIG target languages do not support referencing.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Polymorphous_wrappers_for_function_objects"></a>7.3.7 Polymorphous wrappers for function objects</H3>
|
||||
<H3><a name="CPlusPlus11_polymorphous_wrappers_for_function_objects"></a>7.3.7 Polymorphous wrappers for function objects</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -879,12 +903,12 @@ Example of supported usage of the plain functor from Python is shown below.
|
|||
It does not involve <tt>std::function</tt>.
|
||||
</p>
|
||||
|
||||
<div class="targetlang">
|
||||
<div class="targetlang"><pre>
|
||||
t = Test()
|
||||
b = t(1,2) # invoke C++ function object
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_Type_traits_for_metaprogramming"></a>7.3.8 Type traits for metaprogramming</H3>
|
||||
<H3><a name="CPlusPlus11_type_traits_for_metaprogramming"></a>7.3.8 Type traits for metaprogramming</H3>
|
||||
|
||||
|
||||
<p>The new C++ metaprogramming is useful at compile time and is aimed specifically for C++ development:</p>
|
||||
|
|
@ -909,7 +933,7 @@ template< class T1, class T2 > int elaborate( T1 A, T2 B ) {
|
|||
<p>SWIG correctly parses the template specialization, template types and values inside the <> block and the new helper functions: is_convertible, is_integral, is_const etc.
|
||||
However, SWIG still explicitly requires concrete types when using the <tt>%template</tt> directive, so the C++ metaprogramming features are not really of interest at runtime in the target languages.</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_Uniform_method_for_computing_return_type_of_function_objects"></a>7.3.9 Uniform method for computing return type of function objects</H3>
|
||||
<H3><a name="CPlusPlus11_uniform_method_for_computing_return_type_of_function_objects"></a>7.3.9 Uniform method for computing return type of function objects</H3>
|
||||
|
||||
|
||||
<p>SWIG does not wrap the new result_of class introduced in the <functional> header and map the result_of::type to the concrete type yet. For example:</p>
|
||||
|
|
@ -938,5 +962,6 @@ typename std::result_of<Fun(Arg)>::type test_result_impl(Fun fun, Arg arg)
|
|||
</pre></div>
|
||||
|
||||
<p>Instead, please use <tt>decltype()</tt> where possible for now.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue