| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
We stopped wrapping C++ static method A::bar as A_bar in SWIG 4.1.0.
|
| |
|
|
|
|
| |
For: JavaScript, C#, go, Java, Lua, Perl, PHP, python, Ruby, TCL and Octave.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* python-iterator-protocol:
Finish removal of SwigPySequence_Cont
Remove undocumented and non-existent STL std::carray
Remove assign method uses by the removed Python Sequence Protocol
Remove now redundant use of Python Sequence protocol in STL wrappers
Add support for all STL containers to be constructible from a Python set
Iterator Protocol support for std::array wrappers
STL support for copying Python objects supporting Iterator protocol
Closes #2515
Conflicts:
CHANGES.current
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a regression test based on https://sourceforge.net/p/swig/bugs/1163/
since this patch solves that case too.
Replace the __attribute__ test case from #2525 with a variant of the
1163 regression test, since __attribute__ is specific to certain
compilers.
Adjust the self-referential test case to actually work - it wasn't
valid C code before.
|
| |/ |
|
| |
|
|
|
|
| |
Complete support for C++11 variadic function templates. Support was previously limited
to just one template parameter. Now zero or more template parameters are supported
in the %template instantiation.
|
| |
|
|
|
|
|
| |
Remove warning SWIGWARN_CPP11_VARIADIC_TEMPLATE which was issued if more
than one argument was used for a variadic template.
SwigType enhancement: 'v.' now represents a variadic argument.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously, specifying more than one simple template template parameter
resulted in a parse error. Now multiple template template parameters are
working including instantiation with %template. Example:
template <template<template<class> class, class> class Op, template<class> class X, class Y>
class C { ... };
Closes #624
Closes #1021
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
decltype now accepts C++ expressions instead of just an ID, such as:
int i,j;
... decltype(i+j) ...
... decltype(&i) ...
These result in a warning for non-trivial expressions which SWIG cannot evaluate:
Warning 344: Unable to deduce decltype for 'i+j'.
See 'Type Inference' in CPlusPlus.html for workarounds.
Issue #1589
Issue #1590
|
| | |
|
| |
|
|
| |
Given Visual C++ does not work with these tests (tested with VS2022 17.3 and earlier)
|
| |
|
|
| |
Closes #2048
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Such as:
class X final {};
This no longer gives a syntax error.
This change has introduced one more shift-reduce conflict in the parser.
with a conflict with a C style variable declaration with name final:
class X final;
resulting in a syntax error (for C++ not C). This is an an unusual style
for C++ code and more typical declarations do work:
X final;
Closes #672
|
| |
|
|
|
|
|
| |
Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that
thrown string exception messages can be seen.
Test all language for std::string throws typemaps
|
| | |
|
| |
|
|
| |
To fix overloading when using these types.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For implementing full move semantics when passing parameters by value.
Based on SWIGTYPE && and std::unique_ptr typemaps which implement move
semantics.
Added for all languages, but untested for: Go, Ocaml, R, Scilab (and
unlikely to be fully functional for same reasons as for std::unique_ptr
support).
Issue #999
|
| |
|
|
|
| |
Document rvalue reference outputs behaviour
Test rvalue reference outputs
|
| |
|
|
| |
Work in progress: SWIGTYPE && out typemaps need to take ownership
|
| |
|
|
| |
Also add missing unique_ptr tests for Lua and Racket.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replicated Java implementation.
Fully implemented for:
- C#
- D
- Guile
- Javascript (UTL)
- Lua
- MzScheme
- Octave (UTL)
- Perl (UTL)
- PHP
- Python (UTL)
- Ruby (UTL)
- Tcl (UTL)
PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
|
| |
|
|
| |
To remove D specific keyword rename
|
| | |
|
| |
|
|
|
|
| |
This is a test added for D in previous commit, now expanded to all target languages.
Tidy up counting object instances.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Support running testcases conditional on the compiler supporting
a each language version, like we already handle C++11.
Currently no testcases are actually run in this way for these
newer language versions.
|
| |
|
|
|
|
|
|
|
|
| |
Most of these test D_d twice when they really should be testing
D_d once and D_i once (the variable name is `di` and the values
assigned are integers).
This was wrong in the initial version for Python in
708021a809a566a410ec0e6bf5c63029392315e1 and it looks like subsequent
additions for other languages have just copied that mistake.
|
| |
|
|
|
|
|
|
| |
Fix mishandling of a Python class inheriting from multiple SWIG-wrapped
director classes.
Fixes #422
Fixes https://sourceforge.net/p/swig/bugs/1379/
|
| |
|
|
|
| |
Add docs on additional support
Additional testing for invalid usage for parameter inputs
|
| |
|
|
| |
Ported from std::unique, behaviour is identical with regard to memory ownership/handling
|
| |
|
|
| |
Equivalent to Java/C# implementation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This is the current state of play where the copy constructor and copy
assignment operators are called, even for movable types passed as
function parameters.
|
| |
|
|
|
|
|
| |
The directorin typemaps in the director methods now use std::move on the
input parameter when copying the object from the stack to the heap prior
to the callback into the target language, thereby taking advantage of
move semantics if available.
|
| |
|
|
|
|
|
| |
Simple copy of current auto_ptr support (just suppport for
functions returning std::unique_ptr).
Closes #1722
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhance SWIGTYPE "out" typemaps to use std::move when copying
objects, thereby making use of move semantics when wrapping a function returning
by value if the returned type supports move semantics.
Wrapping functions that return move only types 'by value' now work out the box
without having to provide custom typemaps.
The implementation removed all casts in the "out" typemaps to allow the compiler to
appropriately choose calling a move constructor, where possible, otherwise a copy
constructor. The implementation alsoand required modifying SwigValueWrapper to
change a cast operator from:
SwigValueWrapper::operator T&() const;
to
#if __cplusplus >=201103L
SwigValueWrapper::operator T&&() const;
#else
SwigValueWrapper::operator T&() const;
#endif
This is not backwards compatible for C++11 and later when using the valuewrapper feature
if a cast is explicitly being made in user supplied "out" typemaps. Suggested change
in custom "out" typemaps for C++11 and later code:
1. Try remove the cast altogether to let the compiler use an appropriate implicit cast.
2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the
__cplusplus macro if all versions of C++ need to be supported.
Issue #999
Closes #1044
More about the commit:
Added some missing "varout" typemaps for Ocaml which was falling back to
use "out" typemaps as they were missing.
Ruby std::set fix for SwigValueWrapper C++11 changes.
|
| |\
| |
| |
| |
| |
| | |
* typemap-colon:
Incoporate review suggestions
Allow referencing of typemap keywords inside of "$typemap("
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
More Python std::wstring directors Python testing
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a "docstring" feature is present it will still override a Doxygen comment.
If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
will override the Doxygen comment. If no "docstring" is present then the
"autodoc" feature will not be generated when there is a Doxygen comment.
This way the "autodoc" feature can be specified and used to provide documentation
for 'missing' Doxygen comments.
Closes #1635
|