diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2019-02-13 00:04:26 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2019-02-13 22:46:28 +0000 |
commit | e26f6bb4e21b7adc90fcd916ec3cbd39e583637e (patch) | |
tree | 7495046b14766f26ca0a27b4c7eaf4b5127ee7bd /Lib/java | |
parent | a47c2553f512f8ad1e1c076a81e0baa84fc5f2a1 (diff) | |
download | swig-e26f6bb4e21b7adc90fcd916ec3cbd39e583637e.tar.gz |
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.
Diffstat (limited to 'Lib/java')
-rw-r--r-- | Lib/java/std_vector.i | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/java/std_vector.i b/Lib/java/std_vector.i index cb1752c69..6a66ec10a 100644 --- a/Lib/java/std_vector.i +++ b/Lib/java/std_vector.i @@ -23,7 +23,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { } } -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CREF_TYPE) +%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CONST_REFERENCE) %typemap(javabase) std::vector< CTYPE > "java.util.AbstractList<$typemap(jboxtype, CTYPE)>" %typemap(javainterfaces) std::vector< CTYPE > "java.util.RandomAccess" %proxycode %{ @@ -79,10 +79,10 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef CTYPE value_type; - typedef CTYPE &reference; - typedef CREF_TYPE const_reference; typedef CTYPE *pointer; typedef CTYPE const *const_pointer; + typedef CTYPE &reference; + typedef CONST_REFERENCE const_reference; vector(); vector(const vector &other); @@ -133,7 +133,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { } } - CREF_TYPE doGet(jint index) throw (std::out_of_range) { + CONST_REFERENCE doGet(jint index) throw (std::out_of_range) { jint size = static_cast<jint>(self->size()); if (index >= 0 && index < size) return (*self)[index]; |