The C++ wrappers create a temporary variable for a parameter to be passed to a function. This is initially default constructed and then copy assigned from the instance being passed in from the target language. This is unchanged, however, when the temporary variable is passed to wrapped function, it is now done using std::move. If the type is move constructible, the move constructor will be used instead of the copy constructor. Note that the implementation calls std::move for all user-defined types (non-primitive types passed by value), this excludes anything passed by pointer, reference and arrays. It does also include any type that has not been defined/parsed by SWIG, that is, unknown types. std::move is called via the SWIG_STD_MOVE macro which only calls std::move for C++11 and later code. |
||
|---|---|---|
| .. | ||
| CParse | ||
| DOH | ||
| Doxygen | ||
| Include | ||
| Modules | ||
| Preprocessor | ||
| Swig | ||
| Makefile.am | ||
| README | ||
SWIG Source directory
Source/DOH - A core set of basic datatypes including
strings, lists, hashes, and files. Used
extensively by the rest of SWIG.
Source/Swig - Swig core. Type-system, utility functions.
Source/Preprocessor - SWIG C Preprocessor
Source/CParse - SWIG C Parser (still messy)
Source/Modules - Language modules.
Source/Include - Include files.