Commit graph

107 commits

Author SHA1 Message Date
William S Fulton
ffbde7a132 Fixes for deprecated std::basic_string::reserve() 2022-07-31 01:02:08 +01:00
William S Fulton
f58a6dade3 Add missing hasher and key_type typedefs to C++11 STL containers 2019-03-12 21:59:03 +00:00
William S Fulton
4a25ddbb97 Correct unordered_set/unordered_multiset template Key parameter name 2019-03-12 20:21:19 +00:00
William S Fulton
52063a732b Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
William S Fulton
6d27ead9c0 Add STL container copy constructors where missing
Also provide consistent copy constructor declarations.
2019-02-14 18:53:05 +00:00
William S Fulton
dc34c39c53 Cosmetic STL typedef changes 2019-02-14 08:16:16 +00:00
William S Fulton
40d7f4137e typedef declaration corrections for std::array 2019-02-14 07:38:49 +00:00
William S Fulton
440264e479 Add missing typedefs to std::list + typedef corrections
Numerous missing typedefs added.
std::list<T*>::const_reference and std::list<T*>::reference
specialization typedef fixes.
2019-02-14 07:31:21 +00:00
William S Fulton
e26f6bb4e2 Add missing typedefs to std::vector + typedef corrections
Tests for std::vector of pointers added which check
 std::vector<T*>::const_reference and std::vector<T*>::reference
usage which gave compilation errors in Python and Perl which had
specialized these vectors incorrectly.
2019-02-13 22:46:28 +00:00
William S Fulton
9dd33e6367 Add missing typedefs to std::map 2019-02-13 22:46:27 +00:00
William S Fulton
6d0c495fd0 Add missing parameter names in STL container wrappers
Mostly in STL copy constructors.

Best to have parameter names as they make their way into the wrappers in
some target languages.
2019-02-13 22:45:47 +00:00
luz.paz
6f69830321 follow-up typos 2018-05-17 10:26:00 -04:00
William S Fulton
50f556de39 Cosmetic changes in C++11 std_unordered support files 2017-02-10 19:26:02 +00:00
Takashi Tamura
b8cf6412e8 fix a %fragment argument. 2017-01-29 10:56:36 +09:00
Takashi Tamura
88a76de9fe use %std_container_methods_without_reverse_iterators 2017-01-29 09:47:18 +09:00
Takashi Tamura
9cb90982ee fix Lib/std/std unordered containers 2017-01-28 16:51:21 +09:00
William S Fulton
65689af848 Refactor std_container iterator functions
This is for future improvements in the C++11 unordered containers which
do not have reverse iterators.
2017-01-27 18:45:22 +00:00
William S Fulton
3b03e6addd Fix a few minor inconsistencies in the STL wrappers
Mainly to use a more normal constructor declaration and to enable
classes with more than one template parameter to be used as container types.
2016-11-29 19:35:09 +00:00
Daniel Vollmer
ce1cb85d86 Add <typeinfo> header for std::bad_cast 2016-09-17 13:24:32 +02:00
Daniel Vollmer
2dc87d7485 Add std::bad_cast to std_except.i
This exception occurs when dynamic_cast<T&> fails.

Fixes #783.
2016-09-17 10:26:54 +02:00
William S Fulton
6e9184b6f8 Fix std::vector of pointers which failed if a pointer to a pointer of the container element type existed (Python)
Closes SF Bug 2359417 created after commit 93f0390322 (svn rev 10958)
2016-07-28 22:51:22 +01:00
William S Fulton
6b4e57245d Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-12-12 14:05:46 +00:00
William S Fulton
93eb7eae0b Limited Python/Ruby support for boost::array
Hack to use the std::array support for boost::array.
Is limited as it currently exposes some 'using' bugs in SWIG.
For example, the type system fails to see that pointers to std::array
and pointers to boost::array are the same.

This approach saves having to maintain separate boost::array support.
The 'using' bug ought to be fixed, otherwise separate boost_array.i
files could be easily made from the std_array.i files.
2015-11-27 19:30:22 +00:00
William S Fulton
55bbf68512 Add std::array container wrappers for Python
These work much like any of the other STL containers except Python slicing
is somewhat limited because the array is a fixed size. Only slices of
the full size are supported.
2015-11-17 07:27:48 +00:00
Kris Thielemans
f6b10f299f small suggestions for changes in std_ios.i
Hi

Would it be possible to add the following 2 typedefs to std_ios.i?

 typedef basic_ios<char> ios;
 typedef basic_ios<wchar_t> wios;

at present, it contains only

 %template(ios) basic_ios<char>;
 %template(wios) basic_ios<wchar_t>;

This means however that things like std::ios::openmode are currently not
recognised by SWIG. With the above typedefs, they are. Similar typedefs
should probably be added in std_iostream.i for ostream etc.

Also, while checking std_ios.i, it seems that the definition of basic_ios
has a copy-paste error in the private section (the constructor is still as
ios_base). To avoid confusion, I suggest to change that. Below is a diff
with the suggested changes.

Kris
2014-08-12 23:45:02 +01:00
William S Fulton
be49f5caee Another revert fragment <stdexcept> for non-UTL languages 2014-02-22 20:53:26 +00:00
William S Fulton
2feb2e6fc6 Revert fragment <stdexcept> for non-UTL languages 2014-02-22 01:11:40 +00:00
William S Fulton
0d9a8721f4 Move some header file includes into fragments for UTL languages 2014-02-21 19:02:14 +00:00
William S Fulton
bd5c340062 Add <string> fragment
Removes <string> include specifically for clang
Cuts down on duplicate #include <string> in general
2014-02-15 23:30:14 +00:00
Marvin Greenberg
213774e0b6 Fix issue on clang about implicit instantiation of undefined template
Generated code does not include <string>, which is referenced in templates.
Clang may be incorrectly or aggresively instantiating some template.

E.g.,
import_stl_b_wrap.cxx:3199:51: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>
2014-02-04 11:55:36 -05:00
William S Fulton
92128eef44 C++11 support for new versions of erase and insert in the STL containers.
The erase and insert methods in the containers use const_iterator instead
of iterator in C++11.  There are times when the methods wrapped must match
the parameters exactly. Specifically when full type information for
template types is missing or SWIG fails to look up the type correctly,
for example:

  %include <std_vector.i>
  typedef float Real;
  %template(RealVector) std::vector<Real>;

SWIG does not find std::vector<Real>::iterator because %template using
typedefs does not always work and so SWIG doesn't know if the type is
copyable and so uses SwigValueWrapper<iterator> which does
not support conversion to another type (const_iterator). This resulted
in compilation errors when using the C++11 version of the containers.

Closes #73
2013-12-22 19:52:55 +00:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
Andrew Simmons
5f1fff1849 Copied std::pair<> fragment from Lib/std/std_map.i into Lib/std/std_multimap.i. This fixes an error when a std::multimap template is wrapped by itself. 2013-07-25 18:23:45 +01:00
William S Fulton
e805d5f925 Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up

Conflicts:
	Doc/Devel/engineering.html
	Examples/Makefile.in
	Lib/allegrocl/allegrocl.swg
	Lib/csharp/csharp.swg
	Lib/csharp/enums.swg
	Lib/csharp/enumsimple.swg
	Lib/csharp/enumtypesafe.swg
	Lib/java/java.swg
	Lib/python/pydocs.swg
	Lib/r/rtype.swg
	Source/Include/swigwarn.h
	Source/Modules/octave.cxx
	Source/Modules/python.cxx
	Source/Modules/ruby.cxx
	Source/Swig/scanner.c
	Source/Swig/stype.c
	Source/Swig/swig.h
	configure.ac
2013-01-28 07:01:37 +00:00
Olly Betts
f9566ad2df Fix assorted typos.
From https://sourceforge.net/p/swig/patches/332/ and some others too.
2013-01-08 18:47:40 +13:00
William S Fulton
c20cacad87 Add some missing STL container typedefs for Perl
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13620 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-15 23:04:26 +00:00
William S Fulton
347f2782d2 Fix missing stddef.h when %import of STL containers. Was causing compile failures witht g++-4.6.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12939 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-20 20:07:56 +00:00
William S Fulton
50693941c6 Fix #3475492 - iterating through std::vector wrappers of enumerations.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12916 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-13 07:10:24 +00:00
Stefan Zager
a74909f77b Fixed bug 2811549: const vs. non-const iterators for STL types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12645 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-29 22:36:06 +00:00
William S Fulton
c339c0b4f7 Add missing headers in generated STL wrappers to fix compilation with gcc-4.6
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12547 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-18 06:57:11 +00:00
William S Fulton
25ff4e4927 merge revisions 11877-12162 from trunk to gsoc2009-matevz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12164 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-07-20 23:35:40 +00:00
William S Fulton
ab1cd03979 merge revisions 11243-11872 from trunk to gsoc2009-matevz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12162 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-07-20 21:58:41 +00:00
William S Fulton
85ac524d37 formatting change of const _TP * -> _TP const* merely to aid difference debugging with vector of non-const pointers std::vector specialization
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11979 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-04 22:27:10 +00:00
William S Fulton
7f53260203 merge revisions 11872:11876 from trunk to gsoc2009-matevz branch - license changes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11905 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-03-06 00:51:54 +00:00
William S Fulton
4308dd03cf SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:26:02 +00:00
William S Fulton
fb4ad0b18d Add back in all the deque methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11783 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-15 07:04:32 +00:00
Olly Betts
0633acd24f [PHP] "empty" is a reserved word in PHP, so rename empty() method
on STL classes to "is_empty()" (previously this was automatically
renamed to "c_empty()").
*** POTENTIAL INCOMPATIBILITY ***


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 04:33:58 +00:00
William S Fulton
132376bade Fix std::vector of const pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11704 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-10-20 18:22:16 +00:00
Matevz Jekovec
52149e219d Removed decr-- Hash tables feature.
Added some comments.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11569 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 16:15:36 +00:00
Matevz Jekovec
523817e4ee Added initial support for hash tables unordered_ types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11418 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-18 21:34:53 +00:00