Commit graph

39 commits

Author SHA1 Message Date
William S Fulton
dad7c93ca0 Provide SWIGTYPE MOVE typemaps in swigmove.i
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
2022-09-16 08:36:25 +01:00
William S Fulton
2212af3f4f rvalue reference outputs
Document rvalue reference outputs behaviour
Test rvalue reference outputs
2022-09-08 08:46:32 +01:00
William S Fulton
0b1d3e3e86 Docs on rvalue parameter changes 2022-09-02 08:24:30 +01:00
Olly Betts
a5380ed1c5 Update docs for C++ attribute support 2022-07-08 15:57:29 +12:00
William S Fulton
299880e6a6 Add std::unique support
Simple copy of current auto_ptr support (just suppport for
functions returning std::unique_ptr).

Closes #1722
2022-07-02 16:17:18 +01:00
William S Fulton
bf36bf7d8a Movable and move-only types supported in "out" typemaps.
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.
2022-06-30 17:26:48 +01:00
William S Fulton
017900d57e Extern template tweaks
Document extern template functions support.
Extern templates result in new warning to differentiate
from template explicit instantiation definition warning.
2022-01-25 00:28:08 +00:00
James Gerity
280b82c8ac Document lack of support for auto for C++ variables (#1125) 2021-01-19 10:03:56 +13:00
William S Fulton
e0fb4b8956 html section numbers updated 2019-02-10 17:40:00 +00:00
William S Fulton
7bc928da60 Document C++11 UCS-2 UCS-4 and C++17 UTF8 character literals support 2019-02-10 17:35:34 +00:00
William S Fulton
330ef362f4 Add docs for C++11 ref-qualifiers 2017-08-30 18:17:04 +01:00
Olly Betts
a92137a708 [C++11] Allow static_assert at the top level
And disallow it right after template<T>).

Fixes https://github.com/swig/swig/issues/1031 reported by Artem V L.
2017-08-04 14:09:30 +12:00
William S Fulton
d6a349997c C++11 hash tables documentation 2017-02-10 19:49:58 +00:00
sunoru
8985c34809 Fix some typos in docs and examples and make the code look nicer. 2016-12-31 23:06:56 +08:00
William S Fulton
20cd562e62 C++11 alias templates doc and changes file update 2016-11-02 10:05:39 +00:00
William S Fulton
c74397bfd0 Merge branch 'liorgold-alias-template'
* liorgold-alias-template:
  Warning header cosmetics
  Fix decl attribute in C++11 alias templates
  Add C++11 alias templates
2016-11-02 09:10:59 +00:00
William S Fulton
268b942865 Consistent formatting of example code in the docs 2016-10-23 20:16:35 +01:00
William S Fulton
8c8937dbdb Minor c++11 doc change 2016-07-20 00:04:47 +01:00
Lior Goldberg
d0fc5b7b5b Add C++11 alias templates 2016-07-06 00:31:04 +03:00
William S Fulton
9f37796e80 Add new C++11 type aliasing support to changes file 2016-06-25 16:08:44 +01:00
Lior Goldberg
c363a93d69 Added support for type alias 2016-06-22 23:13:28 +03:00
William S Fulton
925b2a336f HTML fixes for documentation - add meta tag and loose.dtd 2015-12-30 22:22:32 +00:00
William S Fulton
8288ac15a0 Correct links in html documentation using new version of makechap.py
Corrects position of heading text within A and H1, H2, ... elements.
2015-12-30 22:22:32 +00:00
William S Fulton
8c77d4be89 Document new C++11 strongly typed enumerations support. 2014-12-07 17:10:07 +00:00
William S Fulton
f84e1f823b Minor C++11 doc change 2014-10-21 08:02:25 +01:00
Paweł Tomulik
bf201f22b0 correct example in enum class docs 2014-10-16 16:16:33 +02:00
William S Fulton
785d93d9fb html fixes and section updates 2014-03-15 22:45:43 +00:00
William S Fulton
90a9ac99a8 C++11 doc updates 2014-03-14 01:57:17 +00:00
William S Fulton
fd5f4c25aa C++11 alignof alignas testcase and further C++11 doc updates 2014-03-14 01:57:16 +00:00
William S Fulton
9a45a09aec C++11 conversion operator example and docs added 2014-03-14 01:57:15 +00:00
William S Fulton
adc3cfeb57 More C++11 doc and test improvements 2014-03-14 01:57:15 +00:00
William S Fulton
3fb973644e More C++11 doc tweaks 2014-03-14 01:57:15 +00:00
William S Fulton
e186dc13b7 C++11 constexpr variables support added 2014-03-14 01:57:14 +00:00
William S Fulton
5f7f8f17eb C++11 rvalue reference docs updated. 2014-03-03 19:12:12 +00:00
William S Fulton
6a72e16b37 Add C++11 virtual specifier sequences (final and/or override on methods)
Parsing support added. The final and override information is not used or
added to the parse tree atm.
2014-01-03 20:17:48 +00:00
William S Fulton
f4ada30a7e Add support for C++11 noexcept specification in exception specifications 2013-11-21 20:20:56 +00:00
William S Fulton
7a8dd4bb2d Correct html references 2013-11-20 22:24:13 +00:00
William S Fulton
e566c5fa7f 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
2013-11-20 19:12:16 +00:00
William S Fulton
738cc36aab Rename all C++0x to C++11 and cpp0x to cpp11 2013-10-07 20:37:00 +01:00
Renamed from Doc/Manual/Cpp0x.html (Browse further)