Boost logo

Boost Users :

From: Benjamin Schmeling (Benjamin_Schmeling_at_[hidden])
Date: 2005-01-20 12:16:54


Hi,
thanks Ben your advice with radd worked fine. Now when I am going further
for my bigint class I have the problem that methods which take an bigint as
an parameter do not accept longs.

For example:

>>import _PythonLiDIA
>>x=123L;
>>c=_PythonLiDIA.bigint();
>>_PythonLiDIA.gcd(c,x);

Traceback (most recent call last):
  File "test.py", line 132, in ?
    _PythonLiDIA.gcd(a,x);
Boost.Python.ArgumentError: Python argument types in
    _PythonLiDIA.gcd(bigint, long)
did not match C++ signature:
    gcd(LiDIA::bigint, LiDIA::bigint)

I don't know how to achieve implicit convertion at this point, turning an
long automatically into an bigint. The other way round, turning an bigint
into long can be realized by defining __long__.

Is it possible?/Any idea?

Benjamin

 

-- 
GMX im TV ... Die Gedanken sind frei ... Schon gesehen?
Jetzt Spot online ansehen: http://www.gmx.net/de/go/tv-spot

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net