From 5eb46d5f9f106c8367f65ff499d19a6af6c438af Mon Sep 17 00:00:00 2001 From: Alan Woodland Date: Tue, 31 May 2016 20:52:58 +0100 Subject: [PATCH] Be consistent in semantics of %extend on std::list::iterator --- Lib/java/std_list.i | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Lib/java/std_list.i b/Lib/java/std_list.i index dbce830c2..330bff854 100644 --- a/Lib/java/std_list.i +++ b/Lib/java/std_list.i @@ -72,8 +72,10 @@ namespace std { return **$self; } - void advance_unchecked(jint index) { - std::advance(*$self, index); + iterator advance_unchecked(jint index) const { + std::list::iterator ret=*$self; + std::advance(ret, index); + return ret; } } }; @@ -156,7 +158,7 @@ namespace std { private ListIterator init(int index) { pos = $javaclassname.this.begin(); - pos.advance_unchecked(index); + pos = pos.advance_unchecked(index); return this; }