From 169a953991c35c8a7505e34e5e2f71f099169959 Mon Sep 17 00:00:00 2001 From: Gonzalo Garramuno Date: Mon, 29 Oct 2007 16:39:05 +0000 Subject: [PATCH] Added fix for std::pair< iterator, bool >. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10070 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/std_set.i | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/ruby/std_set.i b/Lib/ruby/std_set.i index f5d203724..f4d15e8ec 100644 --- a/Lib/ruby/std_set.i +++ b/Lib/ruby/std_set.i @@ -168,6 +168,15 @@ iterator, reverse_iterator { swig::Iterator::descriptor(),SWIG_POINTER_OWN); } +// Redefine std::set std::pair typemap + %typemap(out,noblock=1,fragment="RubyPairBoolOutputIterator") + std::pair { + $result = rb_ary_new2(2); + RARRAY_PTR($result)[0] = SWIG_NewPointerObj(swig::make_set_nonconst_iterator(%static_cast($1,$type &).first), + swig::Iterator::descriptor(),SWIG_POINTER_OWN); + RARRAY_PTR($result)[1] = SWIG_From(bool)(%static_cast($1,const $type &).second); + RARRAY_LEN($result) = 2; + } %extend { %alias push "<<";