aboutsummaryrefslogtreecommitdiff
path: root/Lib/java
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2019-04-20 11:20:24 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-04-20 11:32:42 +0100
commitd67c133c4a85c72f77bce245b7db4ae047202396 (patch)
tree1f5c9cd2e1d4087dde611de3d12c3087abff28ca /Lib/java
parent77f075b6e8196ea26aa32855a5ae1ada124a02b8 (diff)
downloadswig-d67c133c4a85c72f77bce245b7db4ae047202396.tar.gz
Java/C# std::vector<bool> workarounds for clang
Workaround clang++ 9.1.0 error not knowing std::vector<bool>::const_reference is actually typedef to bool: li_std_vector_wrap.cxx:1838:40: error: no matching constructor for initialization of 'std::vector<bool>::const_reference' Workaround is use const value_type& getitem(int index) throw (std::out_of_range) { ... // bool specialization: bool getitem(int index) throw (std::out_of_range) { ... instead of const_reference_type getitem(int index) throw (std::out_of_range) { ... Although the following would be better, it would require a more complicated implementation: const_reference_type getitem(int index) throw (std::out_of_range) { ... // bool specialization: bool getitem(int index) throw (std::out_of_range) { ...
Diffstat (limited to 'Lib/java')
-rw-r--r--Lib/java/std_vector.i2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/java/std_vector.i b/Lib/java/std_vector.i
index e33270238..955e20cac 100644
--- a/Lib/java/std_vector.i
+++ b/Lib/java/std_vector.i
@@ -129,7 +129,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) {
}
}
- const_reference 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];