//SWIG <-> Ruby - call by refrence for value types

View: New views
1 Messages — Rating Filter:   Alert me  

//SWIG <-> Ruby - call by refrence for value types

by Sören Freudiger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi @all
I'm pretty new to SWIG and Ruby and have a question.

--------------------
C++:
class A {
public:
 foo(int& var){ var+=10;}
};
--------------------

--------------------
Ruby:
var = 10
a = Example::A.new()
a.foo(var)
--------------------

results in: error --> Expected argument 1 of type int &, but got Fixnum 10
(TypeError)

How can I fix that problem. Our C++ code I have to write a ruby interface
for uses a huge number of methods like that...

Best regards,
SirAnn


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user