Commit 59bf624c authored by Torsten Landschoff's avatar Torsten Landschoff

Import upstream release 3.0.9 from swig-3.0.9.tar.gz

parent c13afd38
......@@ -9,8 +9,12 @@ matrix:
env: SWIGLANG=
- os: linux
env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP14=1
env: SWIGLANG= SWIG_CC=gcc-6 SWIG_CXX=g++-6
sudo: required
dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=csharp
......@@ -20,6 +24,11 @@ matrix:
- compiler: gcc
os: linux
env: SWIGLANG=go
- compiler: gcc
os: linux
env: SWIGLANG=go VER=1.5
sudo: required
dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=guile
......@@ -38,6 +47,11 @@ matrix:
- compiler: gcc
os: linux
env: SWIGLANG=lua
- compiler: gcc
os: linux
env: SWIGLANG=lua VER=5.3
sudo: required
dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=octave SWIGJOBS=-j2 # 3.2
......@@ -98,6 +112,9 @@ matrix:
- compiler: gcc
os: linux
env: SWIGLANG=ruby
- compiler: gcc
os: linux
env: SWIGLANG=ruby VER=2.3.0
- compiler: gcc
os: linux
env: SWIGLANG=scilab
......@@ -106,10 +123,28 @@ matrix:
env: SWIGLANG=tcl
- os: linux
env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
dist: trusty
- os: linux
env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
dist: trusty
- os: osx
env: SWIGLANG= SWIG_CC=gcc-4.2 SWIG_CXX=g++-4.2
- compiler: clang
......@@ -154,25 +189,10 @@ matrix:
- compiler: gcc
os: linux
env: SWIGLANG=ocaml
# Occasional gcc internal compiler error
- compiler: gcc
os: linux
env: SWIGLANG=octave SWIGJOBS=-j2 VER=3.8
# Occasional gcc internal compiler error
- compiler: gcc
os: linux
env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.0
# Not quite working yet
- compiler: gcc
os: linux
env: SWIGLANG=python SWIG_FEATURES=-classic
# Not quite working yet
- compiler: gcc
os: linux
env: SWIGLANG=python SWIG_FEATURES=-O
- compiler: clang
os: osx
env: SWIGLANG=go
before_install:
- date -u
- uname -a
......@@ -192,7 +212,7 @@ install:
- $CXX --version
script:
- echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
- if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$SWIGLANG$PY3); fi
- if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
- echo "${CONFIGOPTS[@]}"
- ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
- echo -en 'travis_fold:end:script.1\\r'
......
*** ANNOUNCE: SWIG 3.0.8 (31 Dec 2015) ***
*** ANNOUNCE: SWIG 3.0.9 (29 May 2016) ***
http://www.swig.org
We're pleased to announce SWIG-3.0.8, the latest SWIG release.
We're pleased to announce SWIG-3.0.9, the latest SWIG release.
What is SWIG?
=============
......@@ -27,11 +27,11 @@ Availability
============
The release is available for download on Sourceforge at
http://prdownloads.sourceforge.net/swig/swig-3.0.8.tar.gz
http://prdownloads.sourceforge.net/swig/swig-3.0.9.tar.gz
A Windows version is also available at
http://prdownloads.sourceforge.net/swig/swigwin-3.0.8.zip
http://prdownloads.sourceforge.net/swig/swigwin-3.0.9.zip
Please report problems with this release to the swig-devel mailing list,
details at http://www.swig.org/mail.html.
......
......@@ -20,7 +20,9 @@
#include <sys/wait.h>
#include <sys/mman.h>
#else
#define _WIN32_WINNT 0x0500
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
#include <windows.h>
#include <shlobj.h>
#endif
......
......@@ -653,6 +653,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
......@@ -724,6 +725,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
......@@ -976,6 +978,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
......@@ -1113,7 +1124,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
......@@ -1266,6 +1277,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
......
......@@ -3,6 +3,164 @@ SWIG (Simplified Wrapper and Interface Generator)
See the CHANGES.current file for changes in the current version.
See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.8 (31 Dec 2015)
===========================
2015-12-30: wsfulton
The pdf documentation is now generated by wkhtmltopdf and has colour
for the code snippets just like the html documentation!
2015-12-23: ahnolds
[Python] Fixes for conversion of signed and unsigned integer types:
No longer check for PyInt objects in Python3. Because PyInt_Check
and friends are #defined to the corresponding PyLong methods, this
had caused errors in Python3 where values greater than what could be
stored in a long were incorrectly interpreted as the value -1 with
the Python error indicator set to OverflowError. This applies to
both the conversions PyLong->long and PyLong->double.
Conversion from PyLong to long, unsigned long, long long, and
unsigned long long now raise OverflowError instead of TypeError in
both Python2 and Python3 for PyLong values outside the range
expressible by the corresponding C type. This matches the existing
behavior for other integral types (signed and unsigned ints, shorts,
and chars), as well as the conversion for PyInt to all numeric
types. This also indirectly applies to the size_t and ptrdiff_t
types, which depend on the conversions for unsigned long and long.
2015-12-19: wsfulton
[Python] Python 2 Unicode UTF-8 strings can be used as inputs to char * or
std::string types if the generated C/C++ code has SWIG_PYTHON_2_UNICODE defined.
2015-12-17: wsfulton
Issues #286, #128
Remove ccache-swig.1 man page - please use the CCache.html docs instead.
The yodl2man and yodl2html tools are no longer used and so SWIG no
longer has a dependency on these packages which were required when
building from git.
2015-12-16: zturner/coleb
[Python] Fix Python3.5 interpreter assertions when objects are being
deleted due to an existing exception. Most notably in generators
which terminate using a StopIteration exception. Fixes #559 #560 #573.
If a further exception is raised during an object destruction,
PyErr_WriteUnraisable is used on this second exception and the
original exception bubbles through.
2015-12-14: ahnolds/wsfulton
[Python] Add in missing initializers for tp_finalize,
nb_matrix_multiply, nb_inplace_matrix_multiply, ht_qualname
ht_cached_keys and tp_prev.
2015-12-12: wsfulton
Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-11-25: wsfulton
[Ruby] STL ranges and slices fixes.
Ruby STL container setting slices fixes:
Setting an STL container wrapper slice better matches the way Ruby
arrays work. The behaviour is now the same as Ruby arrays. The only
exception is the default value used when expanding a container
cannot be nil as this is not a valid type/value for C++ container
elements.
Obtaining a Ruby STL container ranges and slices fixes:
Access via ranges and slices now behave identically to Ruby arrays.
The fixes are mostly for out of range indices and lengths.
- Zero length slice requests return an empty container instead of nil.
- Slices which request a length greater than the size of the container
no longer chop off the last element.
- Ranges which used to return nil now return an empty array when the
the start element is a valid index.
Ruby STL container negative indexing support improved.
Using negative indexes to set values works the same as Ruby arrays, eg
%template(IntVector) std::vector<int>;
iv = IntVector.new([1,2,3,4])
iv[-4] = 9 # => [1,2,3,9]
iv[-5] = 9 # => IndexError
2015-11-21: wsfulton
[Ruby, Python] Add std::array container wrappers.
These work much like any of the other STL containers except Python/Ruby slicing
is somewhat limited because the array is a fixed size. Only slices of
the full size are supported.
2015-10-10: wsfulton
[Python] #539 - Support Python 3.5 and -builtin. PyAsyncMethods is a new
member in PyHeapTypeObject.
2015-10-06: ianlancetaylor
[Go] Don't emit a constructor function for a director
class with an abstract method, since the function will
always panic.
2015-10-01: wsfulton
Fix %shared_ptr support for private and protected inheritance.
- Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
is not similarly marked as a smart pointer
- Do not generate code that attempts to cast up the inheritance chain in the
type system runtime in such cases as it doesn't compile and can't be used.
Remove unnecessary warning 520 for %shared_ptr when the base class is ignored.
2015-10-01: vkalinin
Fix #508: Fix segfault parsing anonymous typedef nested classes.
2015-09-26: wsfulton
[Ruby] Add shared_ptr support
2015-09-13: kkaempf
[Ruby] Resolve tracking bug - issue #225.
The bug is that the tracking code uses a ruby hash and thus may
allocate objects (Bignum) while running the GC. This was tolerated in
1.8 but is invalid (raises an exception) in 1.9.
The patch uses a C hash (also used by ruby) instead.
2015-09-09: lyze
[CFFI] Extend the "export" feature in the CFFI module to support
exporting to a specified package.
2015-09-04: olly
[Python] Fix docstrings for %callback functions.
2015-09-03: demi-rluddy
[Go] Removed golang stringing for signed/unsigned char
Changed default handling of signed char* and unsigned char* to be
opaque pointers rather than strings, similarly to how other
languages work.
Any existing code relying on treating signed char* or unsigned
char* as a string can restore the old behavior with typemaps.i by
using %apply to copy the [unchanged] char* behavior.
*** POTENTIAL INCOMPATIBILITY ***
2015-08-07: talby
[Perl] tidy -Wtautological-constant-out-of-range-compare warnings when building generated code under clang
2015-08-07: xantares
[Python] pep257 & numpydoc conforming docstrings:
- Mono-line module docsstring
- Rewrite autodoc parameters section in numpydoc style:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
- One line summary should end with "."
- Adds a blank line after class docstring
2015-08-05: vadz
[Java] Make (char* STRING, size_t LENGTH) typemaps usable for
strings of other types, e.g. "unsigned char*".
Version 3.0.7 (3 Aug 2015)
==========================
......@@ -429,7 +587,7 @@ Version 3.0.3 (30 Dec 2014)
2014-10-21: wsfulton
Fix issue #242 - Use of the "kwargs" feature no longer automatically turns on the
"compactdefaultargs" feature if the target language does not support kwargs.
Only Java and Python support kwargs, so this affects all the other languages.
Only Java and Ruby support kwargs, so this affects all the other languages.
*** POTENTIAL INCOMPATIBILITY ***
......@@ -7695,7 +7853,7 @@ Version 1.3.28 (February 12, 2006)
12/10/2005: mmatus
[UTF]
- Fix unneccessary calls to SWIG_TypeQuery for 'char *'
- Fix unnecessary calls to SWIG_TypeQuery for 'char *'
and 'wchar_t *', problem found by Clay Culver while
profiling the PyOgre project.
......@@ -23418,7 +23576,7 @@ Version 1.1b5 (March 12, 1997)
2/23/97 : Modified Python module to be better behaved under Windows
- Module initialization function is now properly exported.
It should not be neccessary to explicitly export this function
It should not be necessary to explicitly export this function
yourself.
- Bizarre compilation problems when compiling the SWIG wrapper
......
This diff is collapsed.
......@@ -233,6 +233,7 @@ javabody -&gt; csbody
javafinalize -&gt; csfinalize
javadestruct -&gt; csdestruct
javadestruct_derived -&gt; csdestruct_derived
javainterfacecode -&gt; csinterfacecode
</pre></div>
</li>
......@@ -300,6 +301,9 @@ $*javaclassname -&gt; $*csclassname
$javaclazzname -&gt; $csclazzname
$javainput -&gt; $csinput
$jnicall -&gt; $imcall
$javainterfacename -&gt; $csinterfacename
$&amp;javainterfacename -&gt; $&amp;csinterfacename
$*javainterfacename -&gt; $*csinterfacename
</pre></div>
</li>
......
......@@ -997,6 +997,7 @@
<li><a href="Java.html#Java_proper_enums_classes">Proper Java enum classes</a>
<li><a href="Java.html#Java_typeunsafe_enums_classes">Type unsafe enum classes</a>
</ul>
<li><a href="Java.html#Java_interfaces">Interfaces</a>
</ul>
<li><a href="Java.html#Java_directors">Cross language polymorphism using directors</a>
<ul>
......@@ -1593,6 +1594,7 @@
<li><a href="Python.html#Python_absrelimports">Absolute and relative imports</a>
<li><a href="Python.html#Python_absimport">Enforcing absolute import semantics</a>
<li><a href="Python.html#Python_importfrominit">Importing from __init__.py</a>
<li><a href="Python.html#Python_implicit_namespace_packages">Implicit Namespace Packages</a>
</ul>
<li><a href="Python.html#Python_python3support">Python 3 Support</a>
<ul>
......@@ -1792,11 +1794,12 @@
<li><a href="Scilab.html#Scilab_wrapping_pointers">Pointers</a>
<ul>
<li><a href="Scilab.html#Scilab_wrapping_pointers_pointer_adresses">Utility functions</a>
<li><a href="Scilab.html#Scilab_wrapping_pointers_null_pointers">Null pointers</a>
<li><a href="Scilab.html#Scilab_wrapping_pointers_null_pointers">Null pointers:</a>
</ul>
<li><a href="Scilab.html#Scilab_wrapping_structs">Structures</a>
<li><a href="Scilab.html#Scilab_wrapping_cpp_classes">C++ classes</a>
<li><a href="Scilab.html#Scilab_wrapping_cpp_inheritance">C++ inheritance</a>
<li><a href="Scilab.html#Scilab_wrapping_cpp_overloading">C++ overloading</a>
<li><a href="Scilab.html#Scilab_wrapping_pointers_references_values_arrays">Pointers, references, values, and arrays</a>
<li><a href="Scilab.html#Scilab_wrapping_cpp_templates">C++ templates</a>
<li><a href="Scilab.html#Scilab_wrapping_cpp_operators">C++ operators</a>
......@@ -1807,7 +1810,6 @@
<li><a href="Scilab.html#Scilab_typemaps">Type mappings and libraries</a>
<ul>
<li><a href="Scilab.html#Scilab_typemaps_primitive_types">Default primitive type mappings</a>
<li><a href="Scilab.html#Scilab_typemaps_non-primitive_types">Default type mappings for non-primitive types</a>
<li><a href="Scilab.html#Scilab_typemaps_arrays">Arrays</a>
<li><a href="Scilab.html#Scilab_typemaps_pointer-to-pointers">Pointer-to-pointers</a>
<li><a href="Scilab.html#Scilab_typemaps_matrices">Matrices</a>
......
......@@ -446,7 +446,7 @@ type MyClass interface {
MyMethod() int
}
MyClassMyFactoryFunction() MyClass {
func MyClassMyFactoryFunction() MyClass {
// swig magic here
}
</pre>
......
This diff is collapsed.
......@@ -90,11 +90,22 @@ $ swig -javascript -jsc example.i</pre>
$ swig -c++ -javascript -jsc example.i</pre>
</div>
<p>The V8 code that SWIG generates should work with most versions from 3.11.10 up to 3.29.14 and later.</p>
<p>Specify the V8 version when running SWIG (e.g. 3.25.30)</p>
<p>The API headers for V8 &gt;= 4.3.0 define constants which SWIG can use to
determine the V8 version it is compiling for. For versions &lt; 4.3.0, you
need to specify the V8 version when running SWIG. This is specified as a hex
constant, but the constant is read as pairs of decimal digits, so for V8
3.25.30 use constant 0x032530. This scheme can't represent components &gt; 99,
but this constant is only useful for V8 &lt; 4.3.0, and no V8 versions from
that era had a component &gt; 99. For example:</p>
<div class="shell">
<pre>
$ swig -c++ -javascript -v8 -DV8_VERSION=0x032530 example.i</pre>
</div>
<p>If you're targetting V8 &gt;= 4.3.0, you would just run swig like so:</p>
<div class="shell">
<pre>
$ swig -c++ -javascript -v8 example.i</pre>
</div>
<p>This creates a C/C++ source file <code>example_wrap.c</code> or <code>example_wrap.cxx</code>. The generated C source file contains the low-level wrappers that need to be compiled and linked with the rest of your C/C++ application to create an extension module.</p>
<p>The name of the wrapper file is derived from the name of the input file. For example, if the input file is <code>example.i</code>, the name of the wrapper file is <code>example_wrap.c</code>. To change this, you can use the -o option. The wrapped module will export one function which must be called to register the module with the Javascript interpreter. For example, if your module is named <code>example</code> the corresponding initializer for JavascriptCore would be</p>
<div class="code">
......
......@@ -41,6 +41,7 @@ check:
# 3) <pre> <tt> <code> elements do not always select a fixed-width font - try installing the
# Courier font to fix - these have been added to style.css.
generate: SWIGDocumentation.html
wkhtmltopdf --version | grep "with patched qt" || (echo "wkhtmltopdf is not the patched qt version and so cannot be used - download it from http://wkhtmltopdf.org/downloads.html" && false)
wkhtmltopdf --margin-top 20mm --margin-bottom 20mm --margin-left 10mm --margin-right 10mm --header-font-size 6 --footer-font-size 6 --header-spacing 6 --footer-spacing 6 --header-center '[doctitle]' --footer-left '[subsection]' --footer-right '[page]' SWIGDocumentation.html SWIGDocumentation.pdf
SWIGDocumentation.html: swightml.book
......
......@@ -66,6 +66,7 @@ Also, there are a dozen or so examples in the Examples/octave directory, and hun
<p>
As of SWIG 3.0.7, the Octave module is regularly tested with Octave versions 3.2.4, 3.8.1, and 4.0.0.
Use of older Octave versions is not recommended, as these versions are no longer tested with SWIG.
The SWIG runtime exports the function <tt>swig_octave_prereq()</tt> for checking the version of Octave.
</p>
<H2><a name="Octave_nn3">32.2 Running SWIG</a></H2>
......@@ -517,7 +518,7 @@ C++ operator overloading is supported, in a way similar to other modules.
The <tt>swig_ref</tt> type supports all unary and binary operators between itself and all other types that exist in the system at module load time. When an operator is used (where one of the operands is a <tt>swig_ref</tt>), the runtime routes the call to either a member function of the given object, or to a global function whose named is derived from the types of the operands (either both or just the lhs or rhs).
</p>
<p>
For example, if <tt>a</tt> and <tt>b</tt> are SWIG variables in Octave, <tt>a+b</tt> becomes <tt>a.__add(b)</tt>. The wrapper is then free to implement __add to do whatever it wants. A wrapper may define the <tt>__add</tt> function manually, %rename some other function to it, or %rename a C++ operator to it.
For example, if <tt>a</tt> and <tt>b</tt> are SWIG variables in Octave, <tt>a+b</tt> becomes <tt>a.__add__(b)</tt>. The wrapper is then free to implement __add__ to do whatever it wants. A wrapper may define the <tt>__add__</tt> function manually, %rename some other function to it, or %rename a C++ operator to it.
</p>
<p>
By default the C++ operators are renamed to their corresponding Octave operators. So without doing any work, the following interface
......@@ -544,69 +545,69 @@ assert(c.value==5);
Octave operators are mapped in the following way:
</p>
<div class="code"><pre>
__brace a{args}
__brace_asgn a{args} = rhs
__paren a(args)
__paren_asgn a(args) = rhs
__str generates string rep
__not !a
__uplus +a
__uminus -a
__transpose a.'
__hermitian a'
__incr a++
__decr a--
__add a + b
__sub a - b
__mul a * b
__div a / b
__pow a ^ b
__ldiv a \ b
__lshift a << b
__rshift a >> b
__lt a < b
__le a <= b
__eq a == b
__ge a >= b
__gt a > b
__ne a != b
__el_mul a .* b
__el_div a ./ b
__el_pow a .^ b
__el_ldiv a .\ b
__el_and a &amp; b
__el_or a | b
__brace__ a{args}
__brace_asgn__ a{args} = rhs
__paren__ a(args)
__paren_asgn__ a(args) = rhs
__str__ generates string rep
__not__ !a
__uplus__ +a
__uminus__ -a
__transpose__ a.'
__hermitian__ a'
__incr__ a++
__decr__ a--
__add__ a + b
__sub__ a - b
__mul__ a * b
__div__ a / b
__pow__ a ^ b
__ldiv__ a \ b
__lshift__ a << b
__rshift__ a >> b
__lt__ a < b
__le__ a <= b
__eq__ a == b
__ge__ a >= b
__gt__ a > b
__ne__ a != b
__el_mul__ a .* b
__el_div__ a ./ b
__el_pow__ a .^ b
__el_ldiv__ a .\ b
__el_and__ a &amp; b
__el_or__ a | b
</pre></div>
<p>
On the C++ side, the default mappings are as follows:
</p>
<div class="code"><pre>
%rename(__add) *::operator+;
%rename(__add) *::operator+();
%rename(__add) *::operator+() const;
%rename(__sub) *::operator-;
%rename(__uminus) *::operator-();
%rename(__uminus) *::operator-() const;
%rename(__mul) *::operator*;
%rename(__div) *::operator/;
%rename(__mod) *::operator%;
%rename(__lshift) *::operator<<;
%rename(__rshift) *::operator>>;
%rename(__el_and) *::operator&amp;&amp;;
%rename(__el_or) *::operator||;
%rename(__xor) *::operator^;
%rename(__invert) *::operator~;
%rename(__lt) *::operator<;
%rename(__le) *::operator<=;
%rename(__gt) *::operator>;
%rename(__ge) *::operator>=;
%rename(__eq) *::operator==;
%rename(__ne) *::operator!=;
%rename(__not) *::operator!;
%rename(__incr) *::operator++;
%rename(__decr) *::operator--;
%rename(__paren) *::operator();
%rename(__brace) *::operator[];
%rename(__add__) *::operator+;
%rename(__add__) *::operator+();
%rename(__add__) *::operator+() const;
%rename(__sub__) *::operator-;
%rename(__uminus__) *::operator-();
%rename(__uminus__) *::operator-() const;
%rename(__mul__) *::operator*;
%rename(__div__) *::operator/;
%rename(__mod__) *::operator%;
%rename(__lshift__) *::operator<<;
%rename(__rshift__) *::operator>>;
%rename(__el_and__) *::operator&amp;&amp;;
%rename(__el_or__) *::operator||;
%rename(__xor__) *::operator^;
%rename(__invert__) *::operator~;
%rename(__lt__) *::operator<;
%rename(__le__) *::operator<=;
%rename(__gt__) *::operator>;
%rename(__ge__) *::operator>=;
%rename(__eq__) *::operator==;
%rename(__ne__) *::operator!=;
%rename(__not__) *::operator!;
%rename(__incr__) *::operator++;
%rename(__decr__) *::operator--;
%rename(__paren__) *::operator();
%rename(__brace__) *::operator[];
</pre></div>
<p>
......@@ -620,11 +621,11 @@ Octave can also utilise friend (i.e. non-member) operators with a simple %rename
The %extend directive works the same as in other modules.
</p>
<p>
You can use it to define special behavior, like for example defining Octave operators not mapped to C++ operators, or defining certain Octave mechanisms such as how an object prints. For example, the <tt>octave_value::{is_string,string_value,print}</tt> functions are routed to a special method <tt>__str</tt> that can be defined inside an %extend.
You can use it to define special behavior, like for example defining Octave operators not mapped to C++ operators, or defining certain Octave mechanisms such as how an object prints. For example, the <tt>octave_value::{is_string,string_value,print}</tt> functions are routed to a special method <tt>__str__</tt> that can be defined inside an %extend.
</p>
<div class="code"><pre>
%extend A {